콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
950 화면

I have looked at examples of checking if a user belongs to a certain group:

def check_group(self):
if self.user_has_groups('group_here'):
self.flag = True
else:
self.flag = False

However, when I tested this, it checks the groups of the current logged in user and not the user i am viewing as administrator.  How do you get the user being looked at? Sorry I am very new to python and odoo so need all the help.

아바타
취소
베스트 답변

Instead of using 'user_has_group', use the 'has_group' method which will check the record which you are accessing and verify if the user on that record is a part of that group or not.

아바타
취소
작성자

thank you so much! it worked! ^___^ currently just relying on what i could search up being so new... so thank you!