minor fix

This commit is contained in:
Elvis 2023-09-27 13:06:59 -05:00
parent a46568c798
commit 94194da39d
2 changed files with 1 additions and 2 deletions

View File

@ -1 +0,0 @@
,presik,presik,23.09.2023 12:38,file:///home/presik/.config/libreoffice/4;

View File

@ -93,7 +93,7 @@ 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:
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