From 8cb2965e2329ca16a4885a5d54df3bf3c5c23eb8 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Fri, 1 Feb 2019 13:18:24 +0000 Subject: [PATCH] [FIX] stock_account: AVCO with MRP - Create a product P with: Costing Method Average Price Inventory Valuation Perpetual (automated) - Create a component C with, costing 10. - Create a BOM for P: 1 Unit of C - Create a MO for P, validate => a journal entry of 10 is created - Modify the BOM for P: 2 Units of C - Create a MO for P, validate => a journal entry of 15 is created The journal entry should be 20. opw-1928342 closes odoo/odoo#30766 --- addons/stock_account/models/stock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock_account/models/stock.py b/addons/stock_account/models/stock.py index f49bfb3bed3..6aded69386f 100644 --- a/addons/stock_account/models/stock.py +++ b/addons/stock_account/models/stock.py @@ -285,7 +285,7 @@ class StockMove(models.Model): valuation_amount = self._context.get('force_valuation_amount') else: if self.product_id.cost_method == 'average': - valuation_amount = cost if self.location_id.usage == 'supplier' and self.location_dest_id.usage == 'internal' else self.product_id.standard_price + valuation_amount = cost if self.location_id.usage in ['supplier', 'production'] and self.location_dest_id.usage == 'internal' else self.product_id.standard_price else: valuation_amount = cost if self.product_id.cost_method == 'real' else self.product_id.standard_price # the standard_price of the product may be in another decimal precision, or not compatible with the coinage of