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
This commit is contained in:
Sergi Almacellas Abellana committed 2017-07-11 09:26:13 +02:00
1 parent 3ea897168e
commit 2226173c85
1 file changed
+6 -6
+6 -6
View File
@@ -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')