Odoo Help


how to make the view of many2many field same as one2many

Voathnak Lim
on 5/30/13, 10:47 PM 14,213 views

Hello everyone, I added two new fields (many2one, many2many) to the form but i can see that it has the different view. and I need to make the many2many field appear same as one2many(with no "add" button, and have the link "add an item").


Sudhir Arya (ERP Harbor Consulting Services)

--Sudhir Arya (ERP Harbor Consulting Services)--
| 6 8 8
Ahmedabad, India
--Sudhir Arya (ERP Harbor Consulting Services)--

• Co-Founder & Co-Owner at ERP Harbor Consulting Services

• ERP Consultant / ERP Customization / TechnoFunctional Expert

• Sound knowledge in Python, Odoo (Open ERP), XML, PostgreSQL

• Domain knowledge of Sale Management, Purchase Management, Warehouse Management, Manufacturing, Multi Company Configuration & Management, HR Management, Medical Management, Construction Management, Education Management, Point of Sale, Third Party Integrations

• Positive attitude and quick Learner

• Good analytical skill, quick bug and issue tracing and find the solution

• Good knowledge and experience in payment gateway integration with Odoo

• Ready to accept new challenges

• Active Memeber On Stackoverflow 




Sudhir Arya
ERP Harbor Consulting Services
Sudhir Arya (ERP Harbor Consulting Services)
On 5/31/13, 5:00 AM

You can use widget='one2many' in xml. This will change many2many form view to one2many as you want.

For Example:

<field name='your_many2many_field' widget='one2many'/>

thank you Sudhir. yes, you right. but it's not appear the same form/window as many2many after I click on "add an item". what I want to do is just change the view and everything is still many2many.

Voathnak Lim
on 5/31/13, 6:02 AM

You can define internal tree view inside m2m field with editable option.

Sudhir Arya (ERP Harbor Consulting Services)
on 9/21/14, 5:26 AM
On 6/25/13, 5:50 AM

You can use widget="one2many_list" in the xml. This will change many2many field form view or many2one field form view to one2many field view as you want.

For Example:

Example 1: For many2many Field

<field name="fieldname_many2many" widget="one2many_list"/>

Example 2: For many2one Field

Declaration in .py:

  'datas_field1':fields.many2one("ir.attachment",  "DATAS Field")

Declaration in .xml:

 <field name="datas_field1"  readonly="1" widget="one2many_list">
                        <field name="datas_fname"/> 
                        <field name="datas"/>                          

Thanks Vaibh, I added the one2many_list widget to my many2many field but the next window is still appear same as i click on one2many field. I want to show a tree view but it's still show a form view instead.

Voathnak Lim
on 7/4/13, 1:34 AM

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: 5/30/13, 10:47 PM
Seen: 14213 times
Last updated: 6/29/15, 1:20 AM