summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--addons/stock_account/models/stock.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/stock_account/models/stock.py b/addons/stock_account/models/stock.py
index d4564d97959..cadeaea8bb8 100644
--- a/addons/stock_account/models/stock.py
+++ b/addons/stock_account/models/stock.py
@@ -72,7 +72,10 @@ class StockMoveLine(models.Model):
}
move_id.write(move_vals)
if move_id.product_id.valuation == 'real_time':
- move_id.with_context(force_valuation_amount=qty_difference*move_id.price_unit)._account_entry_move()
+ if move_id.product_id.cost_method == 'standard':
+ move_id.with_context(force_valuation_amount=qty_difference * move_id.product_id.standard_price)._account_entry_move()
+ else:
+ move_id.with_context(force_valuation_amount=qty_difference*move_id.price_unit)._account_entry_move()
return super(StockMoveLine, self).write(vals)