How to do it...

  1. Define an attribute attrs on some form element:
<field name="parent_id"
attrs="{
'invisible': [('is_company', '=', True)],
'required': [('is_company', '=', False)]
}" />
  1. Take care that all the fields you refer to are available on your form:
<field name="is_company" invisible="True" /> 

This will make the parent_id field invisible if the partner is a company, and required if it's not a company.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.223.33.157