[FIX] mail: set user_id to an inactive user partner sends a mail to the object partner_id
Before this revision, Assigning a user for which its partner is inactive was sending the assignation notification email to the `partner_id` of the object. e.g. Assigning a task to a user for which its partner is disabled sent the assignation notification email to the customer of the task. opw-787659
This commit is contained in:
@@ -2142,7 +2142,7 @@ class MailThread(models.AbstractModel):
|
||||
|
||||
# add followers coming from res.users relational fields that are tracked
|
||||
user_ids = [values[name] for name in user_field_lst if values.get(name)]
|
||||
user_pids = [user.partner_id.id for user in self.env['res.users'].sudo().browse(user_ids)]
|
||||
user_pids = [user.partner_id.id for user in self.env['res.users'].sudo().browse(user_ids) if user.partner_id.active]
|
||||
for partner_id in user_pids:
|
||||
new_partners.setdefault(partner_id, None)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user