[FIX] account: sign columns amount_untax and amount_tax
In the tree view for account.invoice, two columns are signed
(amount_total and residual) and two columns are not signed
(amount_untaxed and amount_tax).
Now, all the columns with numeric values are signed.
This commit reverts the commit : 622af0b7cc
opw-1964348
closes odoo/odoo#33097
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
@@ -70,6 +70,12 @@ class AccountInvoice(models.Model):
|
||||
self.amount_total_signed = self.amount_total * sign
|
||||
self.amount_untaxed_signed = amount_untaxed_signed * sign
|
||||
|
||||
def _compute_sign_taxes(self):
|
||||
for invoice in self:
|
||||
sign = invoice.type in ['in_refund', 'out_refund'] and -1 or 1
|
||||
invoice.amount_untaxed_invoice_signed = invoice.amount_untaxed * sign
|
||||
invoice.amount_tax_signed = invoice.amount_tax * sign
|
||||
|
||||
@api.onchange('amount_total')
|
||||
def _onchange_amount_total(self):
|
||||
for inv in self:
|
||||
@@ -324,8 +330,12 @@ class AccountInvoice(models.Model):
|
||||
store=True, readonly=True, compute='_compute_amount', track_visibility='always')
|
||||
amount_untaxed_signed = fields.Monetary(string='Untaxed Amount in Company Currency', currency_field='company_currency_id',
|
||||
store=True, readonly=True, compute='_compute_amount')
|
||||
amount_untaxed_invoice_signed = fields.Monetary(string='Untaxed Amount in Invoice Currency', currency_field='currency_id',
|
||||
readonly=True, compute='_compute_sign_taxes')
|
||||
amount_tax = fields.Monetary(string='Tax',
|
||||
store=True, readonly=True, compute='_compute_amount')
|
||||
amount_tax_signed = fields.Monetary(string='Tax in Invoice Currency', currency_field='currency_id',
|
||||
readonly=True, compute='_compute_sign_taxes')
|
||||
amount_total = fields.Monetary(string='Total',
|
||||
store=True, readonly=True, compute='_compute_amount')
|
||||
amount_total_signed = fields.Monetary(string='Total in Invoice Currency', currency_field='currency_id',
|
||||
|
||||
@@ -163,10 +163,10 @@
|
||||
<field name="user_id"/>
|
||||
<field name="date_due"/>
|
||||
<field name="origin"/>
|
||||
<field name="amount_untaxed" string="Tax Excluded"/>
|
||||
<field name="amount_tax"/>
|
||||
<field name="amount_total_signed" string="Total"/>
|
||||
<field name="residual_signed" string="Amount Due"/>
|
||||
<field name="amount_untaxed_invoice_signed" string="Tax Excluded" sum="Total"/>
|
||||
<field name="amount_tax_signed" string="Tax" sum="Total"/>
|
||||
<field name="amount_total_signed" string="Total" sum="Total"/>
|
||||
<field name="residual_signed" string="Amount Due" sum="Amount Due"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
<field name="company_currency_id" invisible="1"/>
|
||||
<field name="state"/>
|
||||
|
||||
Reference in New Issue
Block a user