[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:
@@ -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,
|
||||
})
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user