From 1b7f033bca819d9310cc4015e9baa9773e0cc61b Mon Sep 17 00:00:00 2001 From: "Adrien Peiffer (ACSONE)" Date: Wed, 18 Oct 2017 11:11:25 +0200 Subject: [PATCH] [FIX] account_credit_control: too many attachements in sent emails. closes #559. --- account_credit_control/__openerp__.py | 2 +- account_credit_control/wizards/credit_control_communication.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/account_credit_control/__openerp__.py b/account_credit_control/__openerp__.py index d6de5efc2..a1c23ab1d 100644 --- a/account_credit_control/__openerp__.py +++ b/account_credit_control/__openerp__.py @@ -5,7 +5,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { 'name': 'Account Credit Control', - 'version': '9.0.1.0.1', + 'version': '9.0.1.0.2', 'author': "Camptocamp, " "Tecnativa, " "Odoo Community Association (OCA)", diff --git a/account_credit_control/wizards/credit_control_communication.py b/account_credit_control/wizards/credit_control_communication.py index d39fedb90..dbe6ffb43 100644 --- a/account_credit_control/wizards/credit_control_communication.py +++ b/account_credit_control/wizards/credit_control_communication.py @@ -162,7 +162,6 @@ class CreditCommunication(models.TransientModel): def _generate_emails(self): """ Generate email message using template related to level """ emails = self.env['mail.mail'] - attachments = self.env['ir.attachment'] required_fields = ['subject', 'body_html', 'email_from', @@ -187,7 +186,7 @@ class CreditCommunication(models.TransientModel): comm.credit_control_line_ids.write({'mail_message_id': email.id, 'state': state}) - + attachments = self.env['ir.attachment'] for att in email_values.get('attachments', []): attach_fname = att[0] attach_datas = att[1]