Skip to content

Commit

Permalink
Merge PR #1680 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Apr 22, 2024
2 parents b195bf4 + eb2a544 commit 82ba3a7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion account_invoice_fixed_discount/models/account_move_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,8 @@ def _get_discount_from_fixed_discount(self):
currency = self.currency_id or self.company_id.currency_id
if float_is_zero(self.discount_fixed, precision_rounding=currency.rounding):
return 0.0
return (self.discount_fixed / self.price_unit) * 100
return (
(self.price_unit != 0)
and ((self.discount_fixed) / self.price_unit) * 100
or 0.00
)

0 comments on commit 82ba3a7

Please sign in to comment.