[FIX] mrp: cost report

The unit price on the cost report should not be rounded using the
product UoM.

opw-760299
This commit is contained in:
Nicolas Martinelli
2017-08-01 18:18:51 +02:00
parent 587668797e
commit 4f5b0463ae
+2 -2
View File
@@ -27,7 +27,7 @@ class MrpBomCost(models.AbstractModel):
total = 0.0
for bom_line in result:
line_product = self.env['product.product'].browse(bom_line['product_id'])
price_uom = self.env['product.uom']._compute_qty(line_product.uom_id.id, line_product.standard_price, bom_line['product_uom'])
price_uom = self.env['product.uom']._compute_price(line_product.uom_id.id, line_product.standard_price, bom_line['product_uom'])
line = {
'product_id': line_product,
'product_uom_qty': bom_line['product_qty'],
@@ -45,4 +45,4 @@ class MrpBomCost(models.AbstractModel):
def render_html(self, data=None):
boms = self.env['mrp.bom'].browse(self.ids)
res = self.get_lines(boms)
return self.env['report'].render('mrp.mrp_bom_cost', {'lines': res})
return self.env['report'].render('mrp.mrp_bom_cost', {'lines': res})