[FIX] mass_mailing: Do not alter method signature
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) <xdo@odoo.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
return super(MailMail, self)._postprocess_sent_message(success_pids, failure_reason=failure_reason, failure_type=failure_type)
|
||||
|
||||
Reference in New Issue
Block a user