diff --git a/invoice.py b/invoice.py index abb0daac65..b3da41d638 100644 --- a/invoice.py +++ b/invoice.py @@ -14,10 +14,12 @@ class InvoiceLine(metaclass=PoolMeta): ], states={ 'invisible': (~Eval('is_assets_depreciable', False) - | (Eval('_parent_invoice', {}).get('type', - Eval('invoice_type')) != 'out')), + | (Eval('invoice_type') != 'out')), + 'readonly': Eval('invoice_state') != 'draft', }, - depends=['product', 'is_assets_depreciable']) + depends=[ + 'product', 'is_assets_depreciable', + 'invoice_state', 'invoice_type']) is_assets_depreciable = fields.Function(fields.Boolean( 'Is Assets depreciable'), 'on_change_with_is_assets_depreciable')