跳至内容
菜单
此问题已终结
2 回复
10324 查看

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