Round code price before storage when modifying from product wizard

Closes #13041
This commit is contained in:
Sergi Almacellas Abellana
2024-03-15 19:18:30 +01:00
parent 3da23862c5
commit c3117568ad
+4 -2
View File
@@ -1193,7 +1193,8 @@ class ModifyCostPrice(Wizard):
product.cost_price_method == 'fixed'
and revision.date == today)
or product.type == 'service'):
cost = revision.get_cost_price(product.cost_price)
cost = round_price(
revision.get_cost_price(product.cost_price))
costs[cost].append(product)
records.remove(product)
elif self.model.__name__ == 'product.template':
@@ -1207,7 +1208,8 @@ class ModifyCostPrice(Wizard):
and revision.date == today)
or template.type == 'service'):
for product in template.products:
cost = revision.get_cost_price(product.cost_price)
cost = round_price(
revision.get_cost_price(product.cost_price))
costs[cost].append(product)
records.remove(template)
Revision.save(revisions)