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

Hi,

How to check that a Many2one field is filled or not in the .py and xml file 

Thanks

아바타
취소

in your function check

if self.your_many2one_field:

do this

else:

do this

베스트 답변

Hello

in  py file

if self.<M2O field>:
    # code


in xml file like on domain you can check 

  <field name="field2" domain="[('M2O_field', '!=', False)]"/>
아바타
취소
작성자

thanks