minor fix in move do

This commit is contained in:
Elvis 2023-11-29 09:40:52 -05:00
parent 63ebe591fa
commit 82468fdcd8
1 changed files with 6 additions and 6 deletions

View File

@ -94,12 +94,12 @@ class Move(metaclass=PoolMeta):
product.cost_price = move.unit_price
product.save()
move.set_average_cost()
if hasattr(product, 'standard_margin') and product.standard_margin and product.standard_margin > 0 and move.product.cost_price > 0:
template = product.template
percentage_calculation = round(move.product.cost_price * Decimal(move.product.standard_margin/100), 4)
template.list_price = product.cost_price + percentage_calculation
template.on_change_list_price()
template.save()
if hasattr(product, 'standard_margin') and product.standard_margin and product.standard_margin > 0 and move.product.cost_price > 0:
template = product.template
percentage_calculation = round(move.product.cost_price * Decimal(move.product.standard_margin/100), 4)
template.list_price = product.cost_price + percentage_calculation
template.on_change_list_price()
template.save()
def set_average_cost(self):
AverageCost = Pool().get('product.average_cost')