From da93335d02c453ff48a68a15c5251ee553b1bd9d Mon Sep 17 00:00:00 2001 From: Julien Van Roy Date: Tue, 9 May 2023 12:48:48 +0000 Subject: [PATCH] [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 Signed-off-by: Julien Van Roy --- addons/sale/models/payment_transaction.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/addons/sale/models/payment_transaction.py b/addons/sale/models/payment_transaction.py index 3f4b5dd6efd..79eeb93264d 100644 --- a/addons/sale/models/payment_transaction.py +++ b/addons/sale/models/payment_transaction.py @@ -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): """