Do not allow adding product lines until costs have been calculated.
This commit is contained in:
parent
a1542f8f39
commit
e9986ded17
6
plan.py
6
plan.py
|
@ -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)),
|
||||
|
|
Loading…
Reference in New Issue