From e87df05817c2ca931d16fb6587689f8a9524708e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 7 Mar 2021 11:13:53 +0100 Subject: [PATCH] Add __access__ to Model issue9903 review324601002 --- product.py | 10 ++++++++++ purchase.py | 5 +++++ purchase.xml | 56 ---------------------------------------------------- 3 files changed, 15 insertions(+), 56 deletions(-) diff --git a/product.py b/product.py index b3d0aead5f..00e5904607 100644 --- a/product.py +++ b/product.py @@ -300,6 +300,11 @@ class ProductSupplier( uom = fields.Function( fields.Many2One('product.uom', "UOM"), 'on_change_with_uom') + @classmethod + def __setup__(cls): + super().__setup__() + cls.__access__.update(['product', 'template']) + @classmethod def __register__(cls, module_name): transaction = Transaction() @@ -460,6 +465,11 @@ class ProductSupplierPrice( fields.Many2One('currency.currency', 'Currency'), 'on_change_with_currency') + @classmethod + def __setup__(cls): + super().__setup__() + cls.__access__.add('product_supplier') + @classmethod def __register__(cls, module_name): cursor = Transaction().connection.cursor() diff --git a/purchase.py b/purchase.py index 8cb6451c04..1d4c643311 100644 --- a/purchase.py +++ b/purchase.py @@ -1169,6 +1169,11 @@ class Line(sequence_ordered(), ModelSQL, ModelView): fields.Many2One('currency.currency', 'Currency'), 'on_change_with_currency') + @classmethod + def __setup__(cls): + super().__setup__() + cls.__access__.add('purchase') + @classmethod def __register__(cls, module_name): super().__register__(module_name) diff --git a/purchase.xml b/purchase.xml index b497bac44d..c5395b0868 100644 --- a/purchase.xml +++ b/purchase.xml @@ -387,30 +387,6 @@ this repository contains the full copyright notices and license terms. --> purchase_line_tree_sequence - - - - - - - - - - - - - - - - - - - - - - - - purchase.product_supplier form @@ -465,22 +441,6 @@ this repository contains the full copyright notices and license terms. --> - - - - - - - - - - - - - - - - purchase.product_supplier.price form @@ -512,22 +472,6 @@ this repository contains the full copyright notices and license terms. --> - - - - - - - - - - - - - - - - product.template