summaryrefslogtreecommitdiff
path: root/addons/mrp/models
diff options
context:
space:
mode:
authorAndrea Grazioso (agr-odoo) <agr@odoo.com>2020-11-13 09:55:55 +0000
committerAndrea Grazioso (agr-odoo) <agr@odoo.com>2020-11-13 10:24:17 +0000
commit8b32e558fde3cb3aaa1deb40acb07488d04d343e (patch)
treed0be11e861c7fd6995afb39844c2469224f6f2d3 /addons/mrp/models
parent06d2b067e56ef7fde5e5ad21e99d868ea5914adb (diff)
[FIX] mrp: fix backorder quantity uom
Activate units of measure and workcenters (work operations) Create Product C, uom Kg Create Product F, uom Kg Create BoM for F, 2000g manufactured from 5000g of C Set 1 operation/work order in the BoM: processing Create MO to produce 2kg (change the uom in the MO) of Product F from 5000g Product C Confirm MO and go to the work order put the quantity of Product F to 1 Kg then click Record Production/Mark as Done The manufacturing backorder is automatically created but is not showing the components. This occur because of a mismatch between the uoms, `move._split` expect the parameter `qty` to be based on the product uom, instead it is the quant uom because the BoM was created using a different UoM than the one defined in products opw-2376217 closes odoo/odoo#61707 Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
Diffstat (limited to 'addons/mrp/models')
-rw-r--r--addons/mrp/models/mrp_production.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/addons/mrp/models/mrp_production.py b/addons/mrp/models/mrp_production.py
index 689ba566402..a7952b1a207 100644
--- a/addons/mrp/models/mrp_production.py
+++ b/addons/mrp/models/mrp_production.py
@@ -1403,6 +1403,7 @@ class MrpProduction(models.Model):
for move in production.move_raw_ids | production.move_finished_ids:
if not move.additional:
qty_to_split = move.product_uom_qty - move.unit_factor * production.qty_producing
+ qty_to_split = move.product_uom._compute_quantity(qty_to_split, move.product_id.uom_id, rounding_method='HALF-UP')
move_vals = move._split(qty_to_split)
if not move_vals:
continue