From 72ef6c8db50f49d9582b65e85bcc874b7b8533aa Mon Sep 17 00:00:00 2001 From: Arnold Moyaux Date: Fri, 17 Dec 2021 10:19:49 +0000 Subject: [PATCH] [FIX] sale_mrp: quantity invoiced in cogs is different than qty delivered When a kit is exploded to `stock.move` the quantity is rounded half-up for every move. But during the invoice. The quantity to invoice on kit is rounded up so it could result in differences between the inventory valuation and the cost of the product closes odoo/odoo#81778 X-original-commit: 1a56d6646d44861cea238ae67d2a7becb36c01b3 Signed-off-by: Tiffany Chang Signed-off-by: Arnold Moyaux --- addons/sale_mrp/models/sale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale_mrp/models/sale.py b/addons/sale_mrp/models/sale.py index 4bd14548784..78ca099baa3 100644 --- a/addons/sale_mrp/models/sale.py +++ b/addons/sale_mrp/models/sale.py @@ -121,7 +121,7 @@ class SaleOrderLine(models.Model): order_line.qty_delivered = 0.0 def _get_bom_component_qty(self, bom): - bom_quantity = self.product_id.uom_id._compute_quantity(1, bom.product_uom_id) + bom_quantity = self.product_id.uom_id._compute_quantity(1, bom.product_uom_id, rounding_method='HALF-UP') boms, lines = bom.explode(self.product_id, bom_quantity) components = {} for line, line_data in lines: