Skip to content
Snippets Groups Projects
Commit 75541518 authored by Denis Ledoux's avatar Denis Ledoux
Browse files

[FIX] stock_landed_costs: additional costs with multiple UoMs

When making a landed costs with pickings using
unit of measures different than the default products unit of measure,
the additional costs added to the quants inventory value were wrong.

This is due to the fact the quants unit of measure is always
the quants product unit of measure, while the quantity
in the adjustment lines were assumed in the stock moves
unit of measure.

As there is no unit of measure field on the adjusment lines,
it makes sense to assume the quantity within the product
unit of measure, to display the quantity within the unit
of measure the user uses the most, which is, normally,
the product unit of measure.

Thanks to this, the additional costs added to the quants
inventory value is now correct.

opw-668374
parent e78e57ac
No related branches found
No related tags found
No related merge requests found
......@@ -46,7 +46,7 @@ class stock_landed_cost(osv.osv):
volume = move.product_id and move.product_id.volume * move.product_qty
for quant in move.quant_ids:
total_cost += quant.cost * quant.qty
vals = dict(product_id=move.product_id.id, move_id=move.id, quantity=move.product_uom_qty, former_cost=total_cost, weight=weight, volume=volume)
vals = dict(product_id=move.product_id.id, move_id=move.id, quantity=move.product_qty, former_cost=total_cost, weight=weight, volume=volume)
lines.append(vals)
if not lines:
raise UserError(_('The selected picking does not contain any move that would be impacted by landed costs. Landed costs are only possible for products configured in real time valuation with real price costing method. Please make sure it is the case, or you selected the correct picking'))
......
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