[FIX] stock_account: stock_value and depends
stock value should be recomputed when the standard price change it is not optimal since it is updated in fifo after a delivery but needed when working with standard cost method remaining_value should also be part of the depends since the current value depends on it
This commit is contained in:
@@ -176,7 +176,7 @@ class ProductProduct(models.Model):
|
||||
return sum(moves.mapped('remaining_value'))
|
||||
|
||||
@api.multi
|
||||
@api.depends('stock_move_ids.product_qty', 'stock_move_ids.state', 'product_tmpl_id.cost_method')
|
||||
@api.depends('stock_move_ids.product_qty', 'stock_move_ids.state', 'stock_move_ids.remaining_value', 'product_tmpl_id.cost_method', 'product_tmpl_id.standard_price')
|
||||
def _compute_stock_value(self):
|
||||
for product in self:
|
||||
if product.cost_method in ['standard', 'average']:
|
||||
|
||||
Reference in New Issue
Block a user