Skip to content

Commit

Permalink
[IMP] account_invoice_show_currency_rate: prevent error when balance …
Browse files Browse the repository at this point in the history
…is zero
  • Loading branch information
JordiMForgeFlow committed Feb 3, 2025
1 parent 2fbda5e commit 81796ce
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions account_invoice_show_currency_rate/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ def _compute_currency_rate(self):
for line in self:
if line.move_id.state != "posted" or not line.amount_currency:
continue
line.currency_rate = line.currency_id.round(
abs(line.amount_currency) / abs(line.balance)
line.currency_rate = (
line.currency_id.round(abs(line.amount_currency) / abs(line.balance))
if line.balance
else 0
)
return res

0 comments on commit 81796ce

Please sign in to comment.