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

hello,

 i want to write rule access but before i check domain i must check if XXX_field is exist in res.user or not 

how can i do this 

아바타
취소
베스트 답변

Hi,

You can check if a field exist in a model using the below code:

if 'XXX_field' in self.env['res.users']._fields:
     ...
    Your code

Regards.

아바타
취소
베스트 답변

You can't do that from record rules directly.

아바타
취소
베스트 답변

user_someone = fields.Many2one('res.users')

def function_something(self):

     if user_somone.XXX_field :

           some_code_here

아바타
취소