[FIX] l10n_it_edi: sent certified email without catchall and bounce

Before this commit, when the domain alias was set (e.g. my_domain.com),
the reply-to and the reply-path were filled with default values using
this domain (e.g. reply-to : catchall@my_domain.com and reply-path:
Return-Path: bounce+number@my_domain.com)

Now, both are filled with the sender email.

Fine-tuning of 66c5053

opw-2127407
opw-2161942

closes odoo/odoo#42619

X-original-commit: 417d69c6ec45310ae22d40adfa70080188a1b1f5
Signed-off-by: Josse Colpaert <jco@openerp.com>
This commit is contained in:
Jorge Pinna Puissant
2020-01-02 15:44:15 +00:00
parent eb04e1c9ad
commit 1f4c65ef3e
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -278,7 +278,7 @@ class AccountMove(models.Model):
'attachment_ids': [(6, 0, self.l10n_it_einvoice_id.ids)],
})
mail_fattura = self.env['mail.mail'].sudo().with_context(wo_return_path=True).create({
mail_fattura = self.env['mail.mail'].sudo().with_context(wo_bounce_return_path=True).create({
'mail_message_id': message.id,
'email_to': self.env.company.l10n_it_address_recipient_fatturapa,
})
+2 -2
View File
@@ -368,8 +368,8 @@ class IrMailServer(models.Model):
attachments=None, message_id=None, references=None, object_id=False, subtype='plain', headers=None,
body_alternative=None, subtype_alternative='plain'):
if self.env.context.get('wo_return_path') and headers:
headers.pop('Return-Path', False)
if self.env.context.get('wo_bounce_return_path') and headers:
headers['Return-Path'] = email_from
return super(IrMailServer, self).build_email(email_from, email_to, subject, body, email_cc=email_cc, email_bcc=email_bcc, reply_to=reply_to,
attachments=attachments, message_id=message_id, references=references, object_id=object_id, subtype=subtype, headers=headers,
body_alternative=body_alternative, subtype_alternative=subtype_alternative)