Clear account properties on category when accounting is unchecked

issue10024
review335921002
This commit is contained in:
Cédric Krier committed 2021-04-01 00:07:44 +02:00
1 parent 5d981aa53c
commit 79611f0e1c
1 file changed
+6
+6
View File
@@ -36,6 +36,12 @@ class Category(metaclass=PoolMeta):
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'