From 18191b90557b1b310cdac7a44e0844f64779103b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 25 Aug 2021 12:17:51 +0000 Subject: [PATCH] [FIX] mail: fix wrong override of write Somehow a context parameter was still given to write. This should not happen in new API (Odoo v8). Task-2631873 PR odoo/odoo#75571 --- addons/mail/models/res_groups.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/mail/models/res_groups.py b/addons/mail/models/res_groups.py index a79f129581c..d6134517d45 100644 --- a/addons/mail/models/res_groups.py +++ b/addons/mail/models/res_groups.py @@ -13,11 +13,11 @@ class ResGroups(models.Model): _inherit = 'res.groups' _description = 'Access Groups' - def write(self, vals, context=None): - write_res = super(ResGroups, self).write(vals) + def write(self, vals): + res = super(ResGroups, self).write(vals) if vals.get('users'): # form: {'group_ids': [(3, 10), (3, 3), (4, 10), (4, 3)]} or {'group_ids': [(6, 0, [ids]} user_ids = [command[1] for command in vals['users'] if command[0] == 4] user_ids += [id for command in vals['users'] if command[0] == 6 for id in command[2]] self.env['mail.channel'].search([('group_ids', 'in', self._ids)])._subscribe_users_automatically() - return write_res + return res