From 2226173c85aae07f4447d78b53ecdcd7d1ae9c43 Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Tue, 11 Jul 2017 09:26:13 +0200 Subject: [PATCH] Use accounts_category field for asset and depreciation accounts states The states definition uses the account category field, but indeed the accounts_category field must be used in order to allow defining the taxes on the product when the account_category is filled but the accounts_category is unchecked. issue6631 review43271002 --- product.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/product.py b/product.py index f6b538fc74..f006ffa428 100644 --- a/product.py +++ b/product.py @@ -106,13 +106,13 @@ class Template: ], states={ 'readonly': ~Eval('active', True), - 'required': ~Eval('account_category') & Eval('depreciable'), + 'required': ~Eval('accounts_category') & Eval('depreciable'), 'invisible': (~Eval('depreciable') | (Eval('type', '') != 'assets') | ~Eval('context', {}).get('company') - | Eval('account_category')), + | Eval('accounts_category')), }, - depends=['active', 'depreciable', 'type', 'account_category'])) + depends=['active', 'depreciable', 'type', 'accounts_category'])) account_depreciation_used = MissingFunction( fields.Many2One('account.account', 'Account Depreciation Used'), 'missing_account', 'get_account') @@ -124,13 +124,13 @@ class Template: ], states={ 'readonly': ~Eval('active', True), - 'required': ~Eval('account_category') & Eval('depreciable'), + 'required': ~Eval('accounts_category') & Eval('depreciable'), 'invisible': (~Eval('depreciable') | (Eval('type', '') != 'assets') | ~Eval('context', {}).get('company') - | Eval('account_category')), + | Eval('accounts_category')), }, - depends=['active', 'depreciable', 'type', 'account_category'])) + depends=['active', 'depreciable', 'type', 'accounts_category'])) account_asset_used = MissingFunction( fields.Many2One('account.account', 'Account Asset Used'), 'missing_account', 'get_account')