diff --git a/addons/account_discount/models/account_invoice.py b/addons/account_discount/models/account_invoice.py index f62da34e..58924a10 100644 --- a/addons/account_discount/models/account_invoice.py +++ b/addons/account_discount/models/account_invoice.py @@ -54,10 +54,11 @@ class AccountInvoice(models.Model): discount_value_ratio = \ (self.discount_amount * line.price_subtotal) / \ gross_amount - discount_per_ratio = \ - (discount_value_ratio * 100) / line.price_subtotal - line.write({'discount': discount_per_ratio}) - self._onchange_invoice_line_ids() + if discount_value_ratio: + discount_per_ratio = \ + (discount_value_ratio * 100) / line.price_subtotal + line.write({'discount': discount_per_ratio}) + self._onchange_invoice_line_ids() self._check_constrains() @api.multi diff --git a/addons/sale/report/invoice_report_templates.xml b/addons/sale/report/invoice_report_templates.xml index bf57e4d4..e6d4aa7b 100644 --- a/addons/sale/report/invoice_report_templates.xml +++ b/addons/sale/report/invoice_report_templates.xml @@ -23,6 +23,7 @@