diff --git a/modules/purchase_trade/valuation.py b/modules/purchase_trade/valuation.py index a2a09b8..3142d05 100644 --- a/modules/purchase_trade/valuation.py +++ b/modules/purchase_trade/valuation.py @@ -116,7 +116,7 @@ class ValuationBase(ModelSQL): if line.purchase.company.currency != currency: with Transaction().set_context(date=Date.today()): base_amount = Currency.compute(currency,amount, line.purchase.company.currency) - rate = round(amount / base_amount,6) + rate = round(amount / (base_amount if base_amount else 1),6) last_price = pc.get_last_price() # mtm = round(Decimal(last_price) * qty * Decimal(sign), 2) if last_price else Decimal(0) values.update({