Get users ids from the group – odoo

    def create(self, vals):
        result = super(HrExpenseAdvances,self).create(vals)        
        group_hr_expense_manager_id = self.env[''].xmlid_to_res_id('hr_expense.group_hr_expense_manager')
        hr_expense_managers = self.get_users_from_group(group_hr_expense_manager_id)
        if hr_expense_managers:
        return result
    #passing group id using self.env[''].xmlid_to_res_id('hr_expense.group_hr_expense_manager')
    def get_users_from_group(self,group_id):
        users_ids = []
        sql_query = """select uid from res_groups_users_rel where gid = %s"""                
        params = (group_id,), params)
        results =
        for users_id in results:
        return users_ids

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.