Do not allow adding product lines until costs have been calculated.

This commit is contained in:
Albert Cervera i Areny 2014-07-01 14:47:53 +02:00
parent a1542f8f39
commit e9986ded17
1 changed files with 5 additions and 1 deletions

View File

@ -48,7 +48,11 @@ class Plan(ModelSQL, ModelView):
fields.One2Many('product.cost.plan.product_line', 'plan', 'Products',
domain=[
('parent', '=', None),
]),
],
states={
'readonly': ~Bool(Eval('costs', [0])),
},
depends=['costs']),
'get_products_tree', setter='set_products_tree')
product_cost = fields.Function(fields.Numeric('Product Cost',
digits=(16, DIGITS)),