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 : 6.0
This commit is contained in:
Cédric Krier
2024-10-27 19:43:15 +01:00
parent 03c04ec1c9
commit edb87e7d22
2 changed files with 8 additions and 8 deletions
+4 -4
View File
@@ -237,12 +237,12 @@ class AmendmentLine(ModelSQL, ModelView):
If(Eval('state') == 'draft',
('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',
},
depends=['action', 'state', 'product_uom_category'])
+4 -4
View File
@@ -272,12 +272,12 @@ class AmendmentLine(ModelSQL, ModelView):
If(Eval('state') == 'draft',
('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',
},
depends=['action', 'state', 'product_uom_category'])