Read only cost price from the history product when computing cost value
Closes #13767
This commit is contained in:
@@ -254,11 +254,11 @@ class Product(StockMixin, object, metaclass=PoolMeta):
|
||||
products = [p for p in products
|
||||
if p.create_date <= context['_datetime']]
|
||||
with Transaction().set_context(context):
|
||||
for product in cls.browse(products):
|
||||
for product, h_product in zip(products, cls.browse(products)):
|
||||
# The product may not have a cost price
|
||||
if product.cost_price is not None:
|
||||
if h_product.cost_price is not None:
|
||||
cost_values[product.id] = round_price(
|
||||
Decimal(str(product.quantity)) * product.cost_price)
|
||||
Decimal(str(product.quantity)) * h_product.cost_price)
|
||||
return cost_values
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user