[FIX] repair: warning if negative quantity
Before this commit, you can start a repair order with negative value into its operations (who will cause a dead end when user will try to end it). So, now a check is done when user tries to start it. closes odoo/odoo#37045 Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
This commit is contained in:
@@ -199,6 +199,8 @@ class Repair(models.Model):
|
||||
|
||||
def action_validate(self):
|
||||
self.ensure_one()
|
||||
if self.filtered(lambda repair: any(op.product_uom_qty < 0 for op in repair.operations)):
|
||||
raise UserError(_("You can not enter negative quantities."))
|
||||
if self.product_id.type == 'consu':
|
||||
return self.action_repair_confirm()
|
||||
precision = self.env['decimal.precision'].precision_get('Product Unit of Measure')
|
||||
|
||||
Reference in New Issue
Block a user