Add invisible and readonly state on analytic_accounts

issue6329
review33171002
This commit is contained in:
Cédric Krier
2017-03-13 23:07:37 +01:00
parent 4582235890
commit b5b130d85e
+5
View File
@@ -21,6 +21,11 @@ class SaleLine(AnalyticMixin):
Eval('context', {}).get('company', -1),
Eval('_parent_sale', {}).get('company', -1))),
]
cls.analytic_accounts.states = {
'invisible': Eval('type') != 'line',
'readonly': Eval('sale_state') != 'draft',
}
cls.analytic_accounts.depends.extend(['type', 'sale_state'])
def get_invoice_line(self):
pool = Pool()