changeset 8791aa95da61 in modules/account_stock_anglo_saxon:default details: https://hg.tryton.org/modules/account_stock_anglo_saxon?cmd=changeset&node=8791aa95da61 description: Clear account properties on category when accounting is unchecked
issue10024 review335921002 diffstat: product.py | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diffs (16 lines): diff -r a9fe1d28e0e7 -r 8791aa95da61 product.py --- a/product.py Thu Mar 18 23:04:17 2021 +0100 +++ b/product.py Thu Apr 01 00:07:44 2021 +0200 @@ -36,6 +36,12 @@ def account_cogs_used(self): pass + @fields.depends('accounting', 'account_cogs') + def on_change_accounting(self): + super().on_change_accounting() + if not self.accounting: + self.account_cogs = None + class CategoryAccount(metaclass=PoolMeta): __name__ = 'product.category.account'