[IMP] stock_account: check if standard price before computation
Quick win in standard price. First check if we are in standard before computing the price unit. If not do the standard process. Part-of: odoo/odoo#99411
This commit is contained in:
@@ -360,9 +360,9 @@ class StockMove(models.Model):
|
||||
valued_quantity = 0
|
||||
for valued_move_line in valued_move_lines:
|
||||
valued_quantity += valued_move_line.product_uom_id._compute_quantity(valued_move_line.qty_done, move.product_id.uom_id)
|
||||
unit_cost = abs(move._get_price_unit()) # May be negative (i.e. decrease an out move).
|
||||
if move.product_id.cost_method == 'standard':
|
||||
unit_cost = move.product_id.standard_price
|
||||
unit_cost = move.product_id.standard_price
|
||||
if move.product_id.cost_method != 'standard':
|
||||
unit_cost = abs(move._get_price_unit()) # May be negative (i.e. decrease an out move).
|
||||
svl_vals = move.product_id._prepare_in_svl_vals(forced_quantity or valued_quantity, unit_cost)
|
||||
svl_vals.update(move._prepare_common_svl_vals())
|
||||
if forced_quantity:
|
||||
|
||||
Reference in New Issue
Block a user