Odoo Help


This community 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.


Widget many2many - how disable 'Add an item'?

on 6/12/15, 10:35 AM 2,568 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 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}"/>



| 5 4 7
Lodz, Poland

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


Asked: 6/12/15, 10:35 AM
Seen: 2568 times
Last updated: 5/24/16, 1:31 AM