[FIX] mrp: create a bom with positive quantity
Creation of production order from a bom with 0 quantity to produce will fail. As there is already a constraint on the quantity to produce on MO, this commit adds the same constraint on BoM. closes odoo/odoo#48485 X-original-commit: 1330500885ae096372ab32fba4ffc9db252dd2d4 Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
This commit is contained in:
@@ -74,6 +74,10 @@ class MrpBom(models.Model):
|
||||
required=True
|
||||
)
|
||||
|
||||
_sql_constraints = [
|
||||
('qty_positive', 'check (product_qty > 0)', 'The quantity to produce must be positive!'),
|
||||
]
|
||||
|
||||
@api.onchange('product_id')
|
||||
def onchange_product_id(self):
|
||||
if self.product_id:
|
||||
|
||||
Reference in New Issue
Block a user