From 9560eecd37640e631d849f3f957ccf4998800dfb Mon Sep 17 00:00:00 2001 From: Ajmalcybrosys Date: Mon, 29 Jul 2019 15:30:58 +0530 Subject: [PATCH] [FIX] Bug Fixed 'sale_discount_total' --- sale_discount_total/models/account_invoice.py | 4 ++-- sale_discount_total/models/discount_approval.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sale_discount_total/models/account_invoice.py b/sale_discount_total/models/account_invoice.py index d6d946385..64bb4680f 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._convert(self.amount_total, self.company_id.currency_id) - amount_untaxed_signed = currency_id._convert(self.amount_untaxed, self.company_id.currency_id) + amount_total_company_signed = currency_id._convert(self.amount_total, self.company_id.currency_id, self.company_id, self.date_invoice or fields.Date.today()) + amount_untaxed_signed = currency_id._convert(self.amount_untaxed, self.company_id.currency_id, self.company_id, self.date_invoice or fields.Date.today()) 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 diff --git a/sale_discount_total/models/discount_approval.py b/sale_discount_total/models/discount_approval.py index d2623d9df..f2c79d213 100644 --- a/sale_discount_total/models/discount_approval.py +++ b/sale_discount_total/models/discount_approval.py @@ -75,8 +75,8 @@ class ResDiscountSettings(models.TransientModel): so_double_validation = fields.Selection(related='company_id.so_double_validation',string="Levels of Approvals *", readonly=False) so_double_validation_limit = fields.Float(string="Discount limit requires approval in %", - related='company_id.so_double_validation_limit') + related='company_id.so_double_validation_limit', readonly=False) def set_values(self): super(ResDiscountSettings, self).set_values() - self.so_double_validation = 'two_step' if self.so_order_approval else 'one_step' + self.so_double_validation = 'two_step' if self.so_order_approval else 'one_step' \ No newline at end of file