From b5371d863f00c84fb8712a692d64dfaa142ce91c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 13 Mar 2017 23:06:50 +0100 Subject: [PATCH] Add invisible and readonly state on analytic_accounts issue6329 review28081002 --- invoice.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/invoice.py b/invoice.py index f75d95315c..54761430d4 100644 --- a/invoice.py +++ b/invoice.py @@ -22,6 +22,11 @@ class InvoiceLine(AnalyticMixin): Eval('company', -1))), ] cls.analytic_accounts.depends.append('company') + cls.analytic_accounts.states = { + 'invisible': Eval('type') != 'line', + 'readonly': Eval('invoice_state') != 'draft', + } + cls.analytic_accounts.depends.extend(['type', 'invoice_state']) def _credit(self): pool = Pool()