From fb95cf7b518c21ce5eda58894c1caa861f8b72f8 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Mon, 8 Jul 2019 10:57:40 +0000 Subject: [PATCH] [FIX] mass_mailing: Do not alter method signature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this patch, this method was altering the signature of its parent method, moving the position of `failure_type` to 1 and making the other 2 arguments kw-only. It seems this accidentally didn't break anything because all calls happened to be done in kwarg mode. However, it's very possible that a downstream module that is not based on `mass_mailing` and makes positional calls gets broken when `mass_mailing` is installed. The fix is to respect original method signature. closes odoo/odoo#34648 Signed-off-by: Xavier Dollé (xdo) --- addons/mass_mailing/models/mail_mail.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/mass_mailing/models/mail_mail.py b/addons/mass_mailing/models/mail_mail.py index 6d718a9ffbf..34ef0472c7e 100644 --- a/addons/mass_mailing/models/mail_mail.py +++ b/addons/mass_mailing/models/mail_mail.py @@ -95,7 +95,7 @@ class MailMail(models.Model): return res @api.multi - def _postprocess_sent_message(self, failure_type=None, **kwargs): + def _postprocess_sent_message(self, success_pids, failure_reason=False, failure_type=None): mail_sent = not failure_type # we consider that a recipient error is a failure with mass mailling and show them as failed for mail in self: if mail.mailing_id: @@ -103,5 +103,4 @@ class MailMail(models.Model): mail.statistics_ids.write({'sent': fields.Datetime.now(), 'exception': False}) elif mail_sent is False and mail.statistics_ids: mail.statistics_ids.write({'exception': fields.Datetime.now()}) - return super(MailMail, self)._postprocess_sent_message(failure_type=failure_type, **kwargs) - \ No newline at end of file + return super(MailMail, self)._postprocess_sent_message(success_pids, failure_reason=failure_reason, failure_type=failure_type)