Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2 Antwoorden
10328 Weergaven

Hi,

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

Thanks

Avatar
Annuleer

in your function check

if self.your_many2one_field:

do this

else:

do this

Beste antwoord

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)]"/>
Avatar
Annuleer
Auteur

thanks