'Check whether the current user has the given group.'

@api.model
def check_groups(self, group):

    grouparr = group.split('.')
    if (not grouparr):
        return False
    self._cr.execute('SELECT    1    FROM    res_groups_users_rel\n                                                                                                                WHERE    uid=%s    AND    gid    IN    (\n                                                                                                                                SELECT    res_id    FROM    ir_model_data    WHERE    module=%s    AND    name=%s)', (self._uid, grouparr[0], grouparr[1]))
    return bool(self._cr.fetchone())
