[FIX] sale,account_edi_ubl_cii: CRON should generate the XML attachments

When triggering the CRON "Sale Subscription: generate recurring invoices
and payments", invoices are created from subscriptions, the emails and
xml attachments are sent to the recipients.

Similarly, the CRON "automatic invoicing: send ready invoice" should go
through the Send and Print wizard to be able to create the xml
attachments.

task-3299540

closes odoo/odoo#121075

X-original-commit: 79770f1b5abc79bcf0feb12b4316fc864ba291dd
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Julien Van Roy <juvr@odoo.com>
This commit is contained in:
Julien Van Roy
2023-05-11 10:41:00 +02:00
parent 19aef6396c
commit da93335d02
+1 -5
View File
@@ -146,11 +146,7 @@ class PaymentTransaction(models.Model):
lambda i: not i.is_move_sent and i.state == 'posted' and i._is_ready_to_be_sent()
)
invoice_to_send.is_move_sent = True # Mark invoice as sent
invoice_to_send.with_user(SUPERUSER_ID).message_post_with_source(
template,
email_layout_xmlid='mail.mail_notification_layout_with_responsible_signature',
subtype_xmlid='mail.mt_comment',
)
invoice_to_send.with_user(SUPERUSER_ID)._generate_pdf_and_send_invoice(template)
def _cron_send_invoice(self):
"""