Browse Source

[FIX] Bug Fixed 'sale_discount_total'

pull/124/head
Ajmalcybrosys 6 years ago
parent
commit
9560eecd37
  1. 4
      sale_discount_total/models/account_invoice.py
  2. 4
      sale_discount_total/models/discount_approval.py

4
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

4
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'
Loading…
Cancel
Save