From 0dd08bd148d6b2f74e8800ffe1b72b939876e214 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Fri, 20 Apr 2018 09:06:46 +0200 Subject: [PATCH] [FIX] mrp: change BOM - Create a MO for Product A with quantity to produce of 2 - Produce 1 - Open the associated BOM, and add a line to the bom - Go back to the MO and try to update the qty to produce to 1 Traceback: division by 0 opw-1838006 --- addons/mrp/models/mrp_production.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mrp/models/mrp_production.py b/addons/mrp/models/mrp_production.py index 16325a98500..5e3bb3a91bf 100644 --- a/addons/mrp/models/mrp_production.py +++ b/addons/mrp/models/mrp_production.py @@ -349,7 +349,7 @@ class MrpProduction(models.Model): source_location = routing.location_id else: source_location = self.location_src_id - original_quantity = self.product_qty - self.qty_produced + original_quantity = (self.product_qty - self.qty_produced) or 1.0 data = { 'sequence': bom_line.sequence, 'name': self.name,