From 1fc32169d7f8a3ae6e3a510e38582f65e48656cc Mon Sep 17 00:00:00 2001 From: Sreejith P Date: Fri, 12 Oct 2018 15:52:14 +0530 Subject: [PATCH] [FIX] Function changed --- sale_discount_total/models/account_invoice.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sale_discount_total/models/account_invoice.py b/sale_discount_total/models/account_invoice.py index 9f82af6c7..d6d946385 100644 --- a/sale_discount_total/models/account_invoice.py +++ b/sale_discount_total/models/account_invoice.py @@ -38,8 +38,8 @@ class AccountInvoice(models.Model): amount_untaxed_signed = self.amount_untaxed if self.currency_id and self.currency_id != self.company_id.currency_id: currency_id = self.currency_id.with_context(date=self.date_invoice) - amount_total_company_signed = currency_id.compute(self.amount_total, self.company_id.currency_id) - amount_untaxed_signed = currency_id.compute(self.amount_untaxed, self.company_id.currency_id) + amount_total_company_signed = currency_id._convert(self.amount_total, self.company_id.currency_id) + amount_untaxed_signed = currency_id._convert(self.amount_untaxed, self.company_id.currency_id) sign = self.type in ['in_refund', 'out_refund'] and -1 or 1 self.amount_total_company_signed = amount_total_company_signed * sign self.amount_total_signed = self.amount_total * sign @@ -99,4 +99,4 @@ class AccountInvoice(models.Model): class AccountInvoiceLine(models.Model): _inherit = "account.invoice.line" - discount = fields.Float(string='Discount (%)', digits=(16, 20), default=0.0) \ No newline at end of file + discount = fields.Float(string='Discount (%)', digits=(16, 20), default=0.0)