From 63d54abe4b62480e713f1bb3a1a57dff29eaaedf Mon Sep 17 00:00:00 2001 From: "Mahdi cheikh rouhou (macr)" Date: Tue, 2 May 2023 13:02:39 +0000 Subject: [PATCH] [FIX] account : correct button title invoice email manually Sending invoice in emails to customers now display View Journal Entry in v16.2 instead of view Invoice. Steps to reproduce the error : 1- Install accounting 2- Go to accounting/customers/invoices 3- Create an invoice and send it by email to the customer 4- View The email on mailhog The reason of the error was becayse we didn't provide model_descirption to the function of sending the email, so it will take the one by default whch is Journal Entry. opw-3289880 closes odoo/odoo#120480 X-original-commit: 21cab7ffa6a71a67b64d3a7e7a62a6599127343d Signed-off-by: Nicolas Lempereur (nle) Signed-off-by: Mahdi Cheikh Rouhou (macr) --- addons/account/wizard/account_move_send.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/account/wizard/account_move_send.py b/addons/account/wizard/account_move_send.py index dbd47aaef6a..99f506f0fc7 100644 --- a/addons/account/wizard/account_move_send.py +++ b/addons/account/wizard/account_move_send.py @@ -355,6 +355,7 @@ class AccountMoveSend(models.Model): body = self.mail_body or self._get_default_mail_body(mail_template, mail_lang, move) subject = self.mail_subject or self._get_default_mail_subject(mail_template, mail_lang, move) email_from = self._get_default_email_from(mail_template, mail_lang, move) + model_description = move.with_context(lang=mail_lang).type_name self._send_mail( mail_template, @@ -365,6 +366,7 @@ class AccountMoveSend(models.Model): subtype_id=subtype.id, partner_ids=partners.ids, attachment_ids=attachment_ids, + model_description=model_description, ) def _generate_documents_success_hook(self, moves, from_cron):