[FIX] mass_mailing_partner: prevent singleton error

This commit is contained in:
david 2019-11-20 18:37:56 +01:00 committed by emagdalenaC2i
parent b313196ea2
commit 38ce378348
2 changed files with 4 additions and 4 deletions

View File

@ -5,7 +5,7 @@
{
"name": "Link partners with mass-mailing",
"version": "12.0.1.0.1",
"version": "12.0.1.0.2",
"author": "Tecnativa, "
"Odoo Community Association (OCA)",
"website": "https://github.com/OCA/social",

View File

@ -22,9 +22,9 @@ class PartnerMailListWizard(models.TransientModel):
contact_obj = self.env['mail.mass_mailing.contact']
partners = self.partner_ids
add_list = partners.filtered(lambda r: r.mass_mailing_contact_ids)
if add_list:
add_list.mass_mailing_contact_ids[0].list_ids |= self.mail_list_id
add_list = partners.filtered('mass_mailing_contact_ids')
for partner in add_list:
partner.mass_mailing_contact_ids[0].list_ids |= self.mail_list_id
to_create = partners - add_list
for partner in to_create: