changeset bf524607180c in modules/account_stock_continental:default
details:
https://hg.tryton.org/modules/account_stock_continental?cmd=changeset&node=bf524607180c
description:
Clear account properties on category when accounting is unchecked
issue10024
review335921002
diffstat:
product.py | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diffs (19 lines):
diff -r dd70a5b63cbb -r bf524607180c product.py
--- a/product.py Mon Feb 15 14:02:07 2021 +0100
+++ b/product.py Thu Apr 01 00:07:44 2021 +0200
@@ -85,6 +85,15 @@
def account_stock_out_used(self):
pass
+ @fields.depends(
+ 'accounting', 'account_stock', 'account_stock_in', 'account_stock_out')
+ def on_change_accounting(self):
+ super().on_change_accounting()
+ if not self.accounting:
+ self.account_stock = None
+ self.account_stock_in = None
+ self.account_stock_out = None
+
class CategoryAccount(metaclass=PoolMeta):
__name__ = 'product.category.account'