From e9d97214350d9b088f18da3852182aed74eb6b13 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 --- invoice.py | 5 +++++ invoice.xml | 16 ---------------- payment_term.py | 10 ++++++++++ payment_term.xml | 36 ------------------------------------ 4 files changed, 15 insertions(+), 52 deletions(-) diff --git a/invoice.py b/invoice.py index 80edc40fe7..3cd5b4f87c 100644 --- a/invoice.py +++ b/invoice.py @@ -2418,6 +2418,11 @@ class InvoiceTax(sequence_ordered(), ModelSQL, ModelView): del _states, _depends + @classmethod + def __setup__(cls): + super().__setup__() + cls.__access__.add('invoice') + @classmethod def __register__(cls, module_name): super(InvoiceTax, cls).__register__(module_name) diff --git a/invoice.xml b/invoice.xml index 5e012b2690..0484cb358b 100644 --- a/invoice.xml +++ b/invoice.xml @@ -297,22 +297,6 @@ this repository contains the full copyright notices and license terms. --> invoice_tax_tree_sequence - - - - - - - - - - - - - - - - account.invoice.pay.start form diff --git a/payment_term.py b/payment_term.py index 44029487bb..6df4a9e5f0 100644 --- a/payment_term.py +++ b/payment_term.py @@ -120,6 +120,11 @@ class PaymentTermLine(sequence_ordered(), ModelSQL, ModelView): relativedeltas = fields.One2Many( 'account.invoice.payment_term.line.delta', 'line', 'Deltas') + @classmethod + def __setup__(cls): + super().__setup__() + cls.__access__.add('payment') + @classmethod def __register__(cls, module_name): sql_table = cls.__table__() @@ -245,6 +250,11 @@ class PaymentTermLineRelativeDelta(sequence_ordered(), ModelSQL, ModelView): weeks = fields.Integer('Number of Weeks', required=True) days = fields.Integer('Number of Days', required=True) + @classmethod + def __setup__(cls): + super().__setup__() + cls.__access__.add('line') + @classmethod def __register__(cls, module_name): transaction = Transaction() diff --git a/payment_term.xml b/payment_term.xml index ec0cfc02f4..3f9b6c4509 100644 --- a/payment_term.xml +++ b/payment_term.xml @@ -74,23 +74,6 @@ this repository contains the full copyright notices and license terms. --> payment_term_line_form - - - - - - - - - - - - - - - - account.invoice.payment_term.line.delta @@ -112,25 +95,6 @@ this repository contains the full copyright notices and license terms. --> payment_term_line_relativedelta_form - - - - - - - - - - - - - - - - Test Payment Term account.invoice.payment_term.test