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.
This commit is contained in:
Sergi Almacellas Abellana 2016-07-01 11:39:38 +02:00
parent c292117516
commit d5614f167f
1 changed files with 1 additions and 0 deletions

View File

@ -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)),