Do not allow to add product or unit with amendment if there was no unit
Invoice lines may already exist with incompatible unit which will fail to compute invoiced quantity. (grafted from a261281e016c9445639fd7a47fdf41b8bbb4ab8b) --HG-- branch : 7.0
This commit is contained in:
@@ -250,12 +250,12 @@ class AmendmentLine(ModelSQL, ModelView):
|
||||
& ~(Eval('quantity', 0) < 0),
|
||||
('purchasable', '=', True),
|
||||
()),
|
||||
If(Eval('product_uom_category'),
|
||||
('default_uom_category', '=', Eval('product_uom_category')),
|
||||
()),
|
||||
('default_uom_category', '=', Eval('product_uom_category', -1)),
|
||||
],
|
||||
states={
|
||||
'readonly': Eval('state') != 'draft',
|
||||
'readonly': (
|
||||
(Eval('state') != 'draft')
|
||||
| ~Eval('product_uom_category', None)),
|
||||
'invisible': Eval('action') != 'line',
|
||||
})
|
||||
product_supplier = fields.Many2One(
|
||||
|
||||
@@ -287,12 +287,12 @@ class AmendmentLine(ModelSQL, ModelView):
|
||||
& ~(Eval('quantity', 0) < 0),
|
||||
('salable', '=', True),
|
||||
()),
|
||||
If(Eval('product_uom_category'),
|
||||
('default_uom_category', '=', Eval('product_uom_category')),
|
||||
()),
|
||||
('default_uom_category', '=', Eval('product_uom_category', -1)),
|
||||
],
|
||||
states={
|
||||
'readonly': Eval('state') != 'draft',
|
||||
'readonly': (
|
||||
(Eval('state') != 'draft')
|
||||
| ~Eval('product_uom_category', None)),
|
||||
'invisible': Eval('action') != 'line',
|
||||
})
|
||||
quantity = fields.Float(
|
||||
|
||||
Reference in New Issue
Block a user