'Add the given partner_ids to the current channels and broadcast the channel header to them.
:param partner_ids : list of partner id to add'

@api.multi
def channel_invite(self, partner_ids):

    partners = self.env['res.partner'].browse(partner_ids)
    for channel in self:
        partners_to_add = (partners - channel.channel_partner_ids)
        channel.write({'channel_last_seen_partner_ids': [(0, 0, {'partner_id': partner_id}) for partner_id in partners_to_add.ids]})
        for partner in partners_to_add:
            notification = (_('<div    class="o_mail_notification">joined    <a    href="#"    class="o_channel_redirect"    data-oe-id="%s">#%s</a></div>') % (self.id, self.name))
            self.message_post(body=notification, message_type='notification', subtype='mail.mt_comment', author_id=partner.id)
    self._broadcast(partner_ids)
