From 5f3b3b2ab27ea35084c77302048d75b3351e5c99 Mon Sep 17 00:00:00 2001 From: Nicolas JEUDY Date: Fri, 12 Jul 2019 00:24:57 +0200 Subject: [PATCH] [FIX] write can be multi --- mail_tracking/models/mail_bounced_mixin.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mail_tracking/models/mail_bounced_mixin.py b/mail_tracking/models/mail_bounced_mixin.py index 9f26507b..e2d06305 100644 --- a/mail_tracking/models/mail_bounced_mixin.py +++ b/mail_tracking/models/mail_bounced_mixin.py @@ -31,8 +31,9 @@ class MailBouncedMixin(models.AbstractModel): partners = self.filtered(lambda r: not r.email_bounced) return partners.write({'email_bounced': True}) + @api.multi def write(self, vals): - [email_field] = self._primary_email + [email_field] = self[0]._primary_email if email_field not in vals: return super().write(vals) email = vals[email_field].lower() if vals[email_field] else False