changeset 7604f3d01e05 in modules/account_cash_rounding:default details: https://hg.tryton.org/modules/account_cash_rounding?cmd=changeset&node=7604f3d01e05 description: Send only the required fields when fetching a readonly view definition
issue11134 review380081002 diffstat: account.py | 15 +++++---------- currency.py | 3 +-- purchase.py | 3 +-- 3 files changed, 7 insertions(+), 14 deletions(-) diffs (78 lines): diff -r 672a6e582489 -r 7604f3d01e05 account.py --- a/account.py Wed Apr 06 23:37:41 2022 +0200 +++ b/account.py Fri Apr 08 19:07:12 2022 +0200 @@ -25,8 +25,7 @@ ], states={ 'required': Eval('cash_rounding', False), - }, - depends=['cash_rounding'])) + })) cash_rounding_debit_account = fields.MultiValue(fields.Many2One( 'account.account', "Cash Rounding Debit Account", domain=[ @@ -36,8 +35,7 @@ ], states={ 'required': Eval('cash_rounding', False), - }, - depends=['cash_rounding'])) + })) @classmethod def multivalue_model(cls, field): @@ -62,16 +60,14 @@ ('type', '!=', None), ('closed', '!=', True), ('company', '=', Eval('company', -1)), - ], - depends=['company']) + ]) cash_rounding_debit_account = fields.Many2One( 'account.account', "Cash Rounding Debit Account", domain=[ ('type', '!=', None), ('closed', '!=', True), ('company', '=', Eval('company', -1)), - ], - depends=['company']) + ]) class Invoice(metaclass=PoolMeta): @@ -81,8 +77,7 @@ "Cash Rounding", states={ 'readonly': Eval('state') != 'draft', - }, - depends=['state']) + }) @fields.depends('company', 'type') def on_change_company(self): diff -r 672a6e582489 -r 7604f3d01e05 currency.py --- a/currency.py Wed Apr 06 23:37:41 2022 +0200 +++ b/currency.py Fri Apr 08 19:07:12 2022 +0200 @@ -12,8 +12,7 @@ cash_rounding = fields.Numeric( "Cash Rounding Factor", - digits=(12, Eval('digits', 6)), - depends=['digits']) + digits=(12, Eval('digits', 6))) def cash_round(self, amount, rounding=ROUND_HALF_EVEN): return self._round(amount, self.cash_rounding, rounding) diff -r 672a6e582489 -r 7604f3d01e05 purchase.py --- a/purchase.py Wed Apr 06 23:37:41 2022 +0200 +++ b/purchase.py Fri Apr 08 19:07:12 2022 +0200 @@ -14,8 +14,7 @@ "Cash Rounding", states={ 'readonly': Eval('state') != 'draft', - }, - depends=['state']) + }) @fields.depends('party') def on_change_party(self):