recompute cost_price in product
This commit is contained in:
parent
cd483deefd
commit
a842ac2346
3
stock.py
3
stock.py
|
@ -89,6 +89,9 @@ class Move(metaclass=PoolMeta):
|
|||
# remove origin 'stock.inventory.line' for set average cost
|
||||
if move.origin and move.origin.__name__ in ('purchase.line'):
|
||||
move.set_average_cost()
|
||||
if move.product.cost_price_method == 'fixed':
|
||||
move.product.cost_price = move.unit_price
|
||||
move.product.save()
|
||||
|
||||
def set_average_cost(self):
|
||||
AverageCost = Pool().get('product.average_cost')
|
||||
|
|
Loading…
Reference in New Issue