[FIX] account_edi,l10n_it_edi: missing edi xml attachment
With an mx company setup Create Invoice Validate CFDI Click "Send & Print" Issue: xml not in attachments In e9e9081 FW-port for saas-16.3 `_get_default_email_attachment_data` method was removed opw-3419746 closes odoo/odoo#129414 X-original-commit: 1001f6b5c007360ad2ecd5408cad78a744bf3d36 Signed-off-by: Laurent Smet (las) <las@odoo.com> Signed-off-by: Andrea Grazioso (agr) <agr@odoo.com>
This commit is contained in:
@@ -9,18 +9,13 @@ class AccountMoveSend(models.Model):
|
||||
def _get_mail_attachment_from_doc(self, doc):
|
||||
attachment_sudo = doc.sudo().attachment_id
|
||||
if attachment_sudo.res_model and attachment_sudo.res_id:
|
||||
return [{
|
||||
'id': attachment_sudo.id,
|
||||
'name': attachment_sudo.name,
|
||||
'mimetype': attachment_sudo.mimetype,
|
||||
'placeholder': False,
|
||||
}]
|
||||
return []
|
||||
return attachment_sudo
|
||||
return self.env['ir.attachment']
|
||||
|
||||
def _get_default_email_attachment_data(self, mail_template, move):
|
||||
""" Returns all the placeholder data and mail template data
|
||||
def _get_invoice_extra_attachments(self, move):
|
||||
""" Returns extra edi attachments
|
||||
"""
|
||||
results = super()._get_default_email_attachment_data(mail_template, move)
|
||||
result = super()._get_invoice_extra_attachments(move)
|
||||
for doc in move.edi_document_ids:
|
||||
results += self._get_mail_attachment_from_doc(doc)
|
||||
return results
|
||||
result += self._get_mail_attachment_from_doc(doc)
|
||||
return result
|
||||
|
||||
@@ -8,5 +8,5 @@ class AccountMoveSend(models.Model):
|
||||
|
||||
def _get_mail_attachment_from_doc(self, doc):
|
||||
if doc.edi_format_id.code == 'fattura_pa':
|
||||
return []
|
||||
return self.env['ir.attachment']
|
||||
return super()._get_mail_attachment_from_doc(doc)
|
||||
|
||||
Reference in New Issue
Block a user