Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
10392 มุมมอง

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