From 672d00f782b1dd0e5b1e62b1f7165dd150d593f8 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Mon, 23 Jan 2017 14:04:32 +0100 Subject: [PATCH] [FIX] mrp: Print BOM Structure When using different UOM category in a BOM, printing the BOM structure raised an error. Linked to this commit:7fc1a3ca7b5b2616e9610b3e62975f6eb3c36267 opw:705471 --- addons/mrp/report/mrp_bom_structure_report.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/addons/mrp/report/mrp_bom_structure_report.py b/addons/mrp/report/mrp_bom_structure_report.py index 09971b5106c..b65b74b05f6 100644 --- a/addons/mrp/report/mrp_bom_structure_report.py +++ b/addons/mrp/report/mrp_bom_structure_report.py @@ -16,12 +16,9 @@ class BomStructureReport(models.AbstractModel): res['pname'] = l.product_id.name_get()[0][1] res['pcode'] = l.product_id.default_code qty_per_bom = l.bom_id.product_qty - if uom and uom != l.product_uom_id: - qty = uom._compute_quantity(qty, l.product_uom_id) - if uom and l.product_uom_id != l.bom_id.product_uom_id: - qty_per_bom = l.bom_id.product_uom_id._compute_quantity(qty_per_bom, l.product_uom_id) - res['pqty'] = (l.product_qty *qty)/ qty_per_bom - elif uom: + if uom: + if uom != l.bom_id.product_uom_id: + qty = uom._compute_quantity(qty, l.bom_id.product_uom_id) res['pqty'] = (l.product_qty *qty)/ qty_per_bom else: #for the first case, the ponderation is right