changeset f2208802b82c in modules/account_asset:default
details:
https://hg.tryton.org/modules/account_asset?cmd=changeset&node=f2208802b82c
description:
Clear account properties on category when accounting is unchecked
issue10024
review335921002
diffstat:
product.py | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diffs (20 lines):
diff -r 0558e163df42 -r f2208802b82c product.py
--- a/product.py Wed Mar 24 18:17:55 2021 +0100
+++ b/product.py Thu Apr 01 00:07:44 2021 +0200
@@ -51,6 +51,16 @@
def account_asset_used(self):
pass
+ @fields.depends(
+ 'accounting',
+ 'account_depreciation',
+ 'account_asset')
+ def on_change_accounting(self):
+ super().on_change_accounting()
+ if not self.accounting:
+ self.account_depreciation = None
+ self.account_asset = None
+
class CategoryAccount(metaclass=PoolMeta):
__name__ = 'product.category.account'