From d1389566add4df7884012f898c2608fcbbfb04bf 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 --- sale.py | 6 ++++++ sale.xml | 32 -------------------------------- 2 files changed, 6 insertions(+), 32 deletions(-) diff --git a/sale.py b/sale.py index 1c52de47ed..3337736d01 100644 --- a/sale.py +++ b/sale.py @@ -50,6 +50,11 @@ class PromotionCoupon(ModelSQL, ModelView): 'sale.promotion.coupon.number', 'coupon', "Numbers") promotion = fields.Many2One('sale.promotion', "Promotion", required=True) + @classmethod + def __setup__(cls): + super().__setup__() + cls.__access__.add('promotion') + @classmethod def default_number_of_use(cls): return 0 @@ -71,6 +76,7 @@ class PromotionCouponNumber(DeactivableMixin, ModelSQL, ModelView): @classmethod def __setup__(cls): super(PromotionCouponNumber, cls).__setup__() + cls.__access__.add('coupon') cls.active = fields.Function( fields.Boolean("Active"), 'get_active', searcher='search_active') diff --git a/sale.xml b/sale.xml index ab618330de..8ed4bee467 100644 --- a/sale.xml +++ b/sale.xml @@ -20,22 +20,6 @@ this repository contains the full copyright notices and license terms. --> coupon_list - - - - - - - - - - - - - - - - sale.promotion.coupon.number form @@ -47,22 +31,6 @@ this repository contains the full copyright notices and license terms. --> coupon_number_list - - - - - - - - - - - - - - - - sale.sale