From 3603099a2d821516afbefdb06ab35c8de99683e3 Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Tue, 12 Jul 2016 09:15:42 +0200 Subject: [PATCH] Make taxes readonly until account is set issue4749 review31351002 --- invoice.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/invoice.py b/invoice.py index 6f1fd96ddd..5d0b0740fc 100644 --- a/invoice.py +++ b/invoice.py @@ -1501,9 +1501,9 @@ class InvoiceLine(ModelSQL, ModelView, TaxableMixin): ], states={ 'invisible': Eval('type') != 'line', - 'readonly': _states['readonly'], + 'readonly': _states['readonly'] | ~Bool(Eval('account')), }, - depends=['type', 'invoice_type', 'company'] + _depends) + depends=['type', 'invoice_type', 'company', 'account'] + _depends) invoice_taxes = fields.Function(fields.One2Many('account.invoice.tax', None, 'Invoice Taxes'), 'get_invoice_taxes') origin = fields.Reference('Origin', selection='get_origin', select=True,