From d5614f167fc952955900769af23a983eb5dc353d Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Fri, 1 Jul 2016 11:39:38 +0200 Subject: [PATCH] Manage readonly state on margin fields Related to: https://bugs.tryton.org/issue5628 Now it's allowed to change the cost_price (so the margins are updated) on the quotation state also. --- sale.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sale.py b/sale.py index 58f64e3..a3408ac 100644 --- a/sale.py +++ b/sale.py @@ -71,6 +71,7 @@ class SaleLine: cost_price = fields.Numeric('Cost Price', digits=price_digits, states={ 'invisible': Eval('type') != 'line', + 'readonly': ~Eval('sale_state').in_(['draft', 'quotation']), }, depends=['type']) margin = fields.Function(fields.Numeric('Margin', digits=(16, Eval('_parent_sale', {}).get('currency_digits', 2)),