From 3455a4d0e7a87705cef5a93bdfa78bf9ac3e4a7d Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Tue, 20 Nov 2018 16:45:14 +0000 Subject: [PATCH] [FIX] account: send several invoices => state sent When we print or post_message of an invoice it is set as sent. But when we multiprint, we do not use each invoice post_message but create directly mail.mail then send them in batch. Thus the invoices are not set as "Sent". With this change we make a special case. opw-1910937 closes #28852 --- addons/account/wizard/account_invoice_send.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/account/wizard/account_invoice_send.py b/addons/account/wizard/account_invoice_send.py index 23aa2e97ec2..ba5da81b889 100644 --- a/addons/account/wizard/account_invoice_send.py +++ b/addons/account/wizard/account_invoice_send.py @@ -49,6 +49,8 @@ class AccountInvoiceSend(models.TransientModel): def _send_email(self): if self.is_email: self.composer_id.send_mail() + if self.env.context.get('mark_invoice_as_sent'): + self.mapped('invoice_ids').write({'sent': True}) @api.multi def _print_document(self):