Impacted versions: tested on 10.0 

What are the steps to reproduce your issue?

on runbot 10.0,

1. install mail and hr
2. create a new mail channel : 
   * name: test
   * who can follow : selected group of user
   * authorized group: Employee / Manager
   * auto subscription : Employee / Manager

3. edit the Demo user, and add hime to group Employee Managers

What is the current behavior that you observe?

when I go back to the test mail channel, the Demo user is not subscribed to the channel (only Admin is)

What would be your expected behavior in this case?

Demo user should be subscribed since he belongs to a group which should trigger auto subscription. There is some code in https://github.com/odoo/odoo/blob/9822c42707cab575b4a173b60569da1a1c6725aa/addons/mail/models/res_users.py#L83 which seems to be designed to handle this case, but it does not seem to be working. Upon closer look, this is because the web client is not sending groups_id, but sel_groups_xxxxxxx to write() => the if clause is never true => the auto subscription never happens. 

If I edit the Employee Manager group and add the Demo user, then it works as expected. 


opw782301
""" Update of res.groups class
        - if adding users from a group, check mail.channels linked to this user
          group and subscribe them. This is done by overriding the write method.
    """
    _name = 'res.groups'
    _inherit = 'res.groups'
    @api.multi
    def write(self, vals, context=None):
        write_res = super(res_groups_mail_channel, self).write(vals)
        if vals.get('users'):
            
            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()
        return write_res