Skip to content

Commit

Permalink
[MIG] mail_restrict_follower_selection: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
AurelijaNorvaisaite committed Dec 16, 2024
1 parent e595c19 commit 5b885bf
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion mail_restrict_follower_selection/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

{
"name": "Restrict follower selection",
"version": "16.0.1.0.0",
"version": "17.0.1.0.0",
"author": "Therp BV,Creu Blanca,Odoo Community Association (OCA)",
"license": "AGPL-3",
"category": "Social Network",
Expand Down
4 changes: 2 additions & 2 deletions mail_restrict_follower_selection/models/mail_thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ def _message_add_suggested_recipient(
"mail.wizard.invite"
]._mail_restrict_follower_selection_get_domain()
for key in result:
for partner_id, email, lang, reason in result[key]:
for partner_id, *_values in result[key]:
if partner_id:
partner = self.env["res.partner"].search_count(
[("id", "=", partner_id)] + domain
)
if not partner:
result[key].remove((partner_id, email, lang, reason))
result[key].remove((partner_id, *_values))
return result
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ def _mail_restrict_follower_selection_get_domain(self, res_model=None):

@api.model
def get_view(self, view_id=None, view_type="form", **options):
result = super(MailWizardInvite, self).get_view(
view_id=view_id, view_type=view_type, **options
)
result = super().get_view(view_id=view_id, view_type=view_type, **options)
arch = etree.fromstring(result["arch"])
for field in arch.xpath('//field[@name="partner_ids"]'):
field.attrib["domain"] = str(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def send_action(self):
{
"subject": "From Composer Test",
"body": "${object.description}",
"res_id": self.partner.id,
"res_ids": self.partner.ids,
"partner_ids": [(4, id) for id in self.partner.ids],
}
)
Expand Down

0 comments on commit 5b885bf

Please sign in to comment.