[FIX] account: invoice mail subtitle

Have an invoice marked as paid
Send by email

Issue:
Email will contain "$ <amount> due <due date>" which is confusing for
the user as the invoice is already paid

opw-3289653

closes odoo/odoo#120905

X-original-commit: 5c66a766abed5142d77835dcfda423abdcb1429f
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
This commit is contained in:
Andrea Grazioso (agr-odoo)
2023-05-10 02:00:53 +02:00
parent a1c5e9a8b1
commit 2d3f6f9488
+1 -1
View File
@@ -4229,7 +4229,7 @@ class AccountMove(models.Model):
force_email_company=force_email_company, force_email_lang=force_email_lang
)
subtitles = [render_context['record'].name]
if self.invoice_date_due:
if self.invoice_date_due and self.payment_state not in ('in_payment', 'paid'):
subtitles.append(_('%(amount)s due\N{NO-BREAK SPACE}%(date)s',
amount=format_amount(self.env, self.amount_total, self.currency_id, lang_code=render_context.get('lang')),
date=format_date(self.env, self.invoice_date_due, date_format='short', lang_code=render_context.get('lang'))