[FIX] mass_mailing_partner: prevent singleton error
This commit is contained in:
parent
b313196ea2
commit
38ce378348
@ -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",
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user