[FIX] account, sale, purchase: fix multi invoice/quotation/purchase printing

The issue:
having 2 invoices/quotations/purchase orders with different customer, each customer has a different language, the 'Unaxed amount' string will get translated into the first language of the first invoice partner.

The fix:
recompute the total when the lang context change

opw-3569173

closes odoo/odoo#146311

X-original-commit: d48a09738bdde4050bc75f82480ff47ddeb8b553
Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
This commit is contained in:
AMZIL Ayoub
2023-12-15 13:05:35 +00:00
parent 40b19d8984
commit dfc49f1545
3 changed files with 3 additions and 0 deletions
+1
View File
@@ -1212,6 +1212,7 @@ class AccountMove(models.Model):
else:
move.invoice_payments_widget = False
@api.depends_context('lang')
@api.depends(
'invoice_line_ids.currency_rate',
'invoice_line_ids.tax_base_amount',
+1
View File
@@ -197,6 +197,7 @@ class PurchaseOrder(models.Model):
name += ': ' + formatLang(self.env, po.amount_total, currency_obj=po.currency_id)
po.display_name = name
@api.depends_context('lang')
@api.depends('order_line.taxes_id', 'order_line.price_subtotal', 'amount_total', 'amount_untaxed')
def _compute_tax_totals(self):
for order in self:
+1
View File
@@ -640,6 +640,7 @@ class SaleOrder(models.Model):
current_amount=(order.amount_total / order.currency_rate),
)
@api.depends_context('lang')
@api.depends('order_line.tax_id', 'order_line.price_unit', 'amount_total', 'amount_untaxed', 'currency_id')
def _compute_tax_totals(self):
for order in self: