How to remove “Create and Edit” option from the many2one field

When you search in a Many2one field you can see at the bottom of the dropdown an option that says “Create and Edit” if you click on it a new window will be opened where you can create a new object of the relational model. This option is enabled by default but if you don’t want that behaviour for some fields you can remove it simply by adding in the field definition of the view:

options="{'no_create': True}"

For example, if you need to add a new view where one of the fields is payment_term, and you don’t want this option to show up in the dropdown of it, its definition should look like:

<field name="payment_term" options="{'no_create': True}"/>
Share the knowledge!

1 Comments

Leave a Reply

Your email address will not be published.