[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.
This commit is contained in:
svs-odoo
2019-09-18 07:50:59 +00:00
parent 36b1843b43
commit dd45b5123d
+2
View File
@@ -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)