From dd45b5123d83d23692f76935a281e17cfde22429 Mon Sep 17 00:00:00 2001 From: svs-odoo Date: Tue, 17 Sep 2019 13:41:00 +0000 Subject: [PATCH] [FIX] repair: don't warns quantity for consumable When user confirms a repair order for a consumable product, they always get a warning wizard about insufficient quantity. But as we don't track quantity for consumables, this wizard is useless. --- addons/repair/models/repair.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/repair/models/repair.py b/addons/repair/models/repair.py index 5a38df4c1ad..3a1fe59b63c 100644 --- a/addons/repair/models/repair.py +++ b/addons/repair/models/repair.py @@ -199,6 +199,8 @@ class Repair(models.Model): def action_validate(self): self.ensure_one() + if self.product_id.type == 'consu': + return self.action_repair_confirm() precision = self.env['decimal.precision'].precision_get('Product Unit of Measure') available_qty_owner = self.env['stock.quant']._get_available_quantity(self.product_id, self.location_id, self.lot_id, owner_id=self.partner_id, strict=True) available_qty_noown = self.env['stock.quant']._get_available_quantity(self.product_id, self.location_id, self.lot_id, strict=True)