Skip to content
Snippets Groups Projects
Commit 28755e1f authored by Goffin Simon's avatar Goffin Simon
Browse files

[FIX] sale_mrp: Wrong call of _compute_quantity

The signature of the function _compute_quantity is
 _compute_quantity(self, qty, to_unit, round=True, rounding_method='UP')
With courtesy of @PierreFaniel

Closes #19682

opw:774104
parent 571b1a10
No related branches found
No related tags found
No related merge requests found
......@@ -69,14 +69,14 @@ class SaleOrderLine(models.Model):
if uom.id != components[product]['uom']:
from_uom = uom
to_uom = self.env['product.uom'].browse(components[product]['uom'])
qty = from_uom._compute_quantity(qty, to_uom_id=to_uom)
qty = from_uom._compute_quantity(qty, to_uom)
components[product]['qty'] += qty
else:
# To be in the uom reference of the product
to_uom = self.env['product.product'].browse(product).uom_id
if uom.id != to_uom.id:
from_uom = uom
qty = from_uom._compute_quantity(qty, to_uom_id=to_uom)
qty = from_uom._compute_quantity(qty, to_uom)
components[product] = {'qty': qty, 'uom': to_uom.id}
return components
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment