Odoo Help


How to select multiple products in one2many field ?

on 11/4/14, 3:16 AM 4,049 views

Hi all,

I have created one2many field for selecting products, i click search more option it is showing the tree view, for this i need to select multiple products at a time in this tree view(one2many). is it possible in one2many field?

Can you provide me any suggestions.

Thanks in advance.

can you please explain your use of that field??

Baiju KS
on 11/4/14, 5:43 AM

Hi Baiju, In purchase order form=> purchase order tab need to select multiple products at a time. please provide me any code to do that.

on 11/4/14, 5:48 AM
We can do that by modifying that field. but to understand what to do,,, you have to specify me the correct use, i mean your need to do that.. so that i can understand what to do correctly...
waiting for reply.
thank you

Subject: Re: How to select multiple products in one2many field ?
From: madhubabu.chitveli@gmail.com
To: baijuks@hotmail.com
Date: Tue, 4 Nov 2014 10:48:44 +0000

Hi Baiju, In purchase order form=> purchase order tab need to select multiple products at a time. please provide me any code to do that.

Thanks in Advance.

Sent by OpenERP S.A. using Odoo about Forum Post How to select multiple products in one2many field ?
Baiju KS
on 11/4/14, 2:48 PM

Baiju KS

--Baiju KS--
| 5 5 8
Kochi, India
--Baiju KS--
ODOO technical

        I like learning new thing, especially technical thing. I am a quick learner, I can learn technical things very fast. I have good logical skill,  I have immense interest in programming.

e-mail id : baijuks@hotmail.com

Baiju KS
On 11/4/14, 4:05 AM

To select multiple items you can use many2many field.

In view you have to specify mamy2many tag widget


'field_name' : fields.many2many('object.name', string='Details'),

                                <field name="field_name" widget="many2many_tags" />


Thanks Baiju, but my question is different.

on 11/4/14, 4:31 AM
Muhammad Bilal
On 9/16/16, 8:00 AM

Although the question is quite old, but still I am answering it for those who are still searching for the solution:

You can use this module to add checkboxes and a button to perform and action on selected records for x2many fields tree view:



Techno-Functional Associate with 7+ years of experience in Odoo (formerly known as OpenERP).

On 9/17/16, 3:40 AM

Assuming you have created a lines for an object, now those lines are defined in the List/Tree View.

Suppose if you created a field for Product say (many2one), then yes it will show you list of products from which you can select only one at a time.

So instead change the datatype of the product to Many2Many.


Object A (parent)

lines = fields.One2Many(ObjectB)

Object B (child)

product_ids = fields.Many2Many(product.product)

This way it will let add multiple products into your lines (one2many lines). Hope this helps you

On 11/4/14, 4:22 AM


One2Many field is the virtual field which is used relative to Many2One relationship.

For Example:

Object X:

f1:ManytoOne in OBject Y

Object Y:

f2:ManytoOne in OBject X.f1

It is better to create the Many2Many relationship for storing the multiple values.

Thanks for answer Rajiv, but in many2one relationship also we will select only one item, but i want to select multiple items using one2many field.

on 11/4/14, 4:38 AM

I have no idea of selecting multiple items with one2many as its virtual field for the many2one field. Let us expect the answers for this.

on 11/6/14, 7:06 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

2 follower(s)


Asked: 11/4/14, 3:16 AM
Seen: 4049 times
Last updated: 9/17/16, 3:40 AM