mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
Merge branch 'fix/12.0/stock_landed_costs_average' into '12.0'
fix/12.0/stock_landed_costs_average into 12.0 See merge request hibou-io/hibou-odoo/suite!421
This commit is contained in:
@@ -88,6 +88,7 @@ class LandedCost(models.Model):
|
|||||||
('id', 'in', quant_loc_ids)])
|
('id', 'in', quant_loc_ids)])
|
||||||
qty_available = line.product_id.with_context(location=locations.ids).qty_available
|
qty_available = line.product_id.with_context(location=locations.ids).qty_available
|
||||||
total_cost = (qty_available * line.product_id.standard_price) + cost_to_add
|
total_cost = (qty_available * line.product_id.standard_price) + cost_to_add
|
||||||
|
if qty_available > 0:
|
||||||
line.product_id.write({'standard_price': total_cost / qty_available})
|
line.product_id.write({'standard_price': total_cost / qty_available})
|
||||||
|
|
||||||
move = move.create(move_vals)
|
move = move.create(move_vals)
|
||||||
|
|||||||
Reference in New Issue
Block a user