Odoo Help


Widget many2many - how disable 'Add an item'?

on 6/12/15, 10:35 AM 5,688 views

I need a widget many2many (or one2many) with disabled 'Add an item' but NOT READONLY!

Not readonly because I need manipulate sequences by drag and drop. How to do it?

Thanks in advance with the help

Andre de Kock
On 6/14/15, 8:28 AM

Try to disable it in the tree view. Like this:

<tree create="false">
    <!-- Fields -->

The create="false" attribute will hide the "Add an item" action on the one2many / many2many view.

On 6/14/15, 11:45 AM

Thank Andre for your very helpful suggestion. Below full solution:

I replace:

 <field name="route_new_ids" widget="many2many" domain="[('product_id','=',id)]"/>


 <field name="route_new_ids" domain="[('product_id','=',id)]" context="{'from_product': True}">
<tree create="false" delete="false">
  <field name="sequence" widget="handle"/>
  <field name="route_id"/>

context="{'from_product': True}" allows to disable, after click on list position, in form view, editions other fields than sequence

Great! Glad I could help

Limitless Virtual Enterprise, Andre de Kock
on 6/15/15, 4:41 AM
On 5/24/16, 1:31 AM

options="{'no_create_edit': True}"

specify this in your many2many field,

<field name="your_field" widget="many2many_tags" options="{'no_create_edit': True}"/>

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 6/12/15, 10:35 AM
Seen: 5688 times
Last updated: 3/15/17, 4:05 PM