Odoo Help

Welcome!

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.

0

How to select multiple products in one2many field ?

By
babu
on 11/4/14, 3:16 AM 2,118 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
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.

babu
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
on 11/4/14, 2:48 PM
3

Baiju

--Baiju--
3154
| 5 4 8
Kochi, India
--Baiju--
ODOO technical and functional

        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
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

Eg:

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

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

 

Thanks Baiju, but my question is different.

babu
on 11/4/14, 4:31 AM
0

deep

--deep--
1617
| 5 4 7
Bengaluru, India
--deep--

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

deep
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.


Example:

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


0
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:

https://www.odoo.com/apps/modules/master/web_x2many_selectable/

0
Rajiv
On 11/4/14, 4:22 AM

Hi

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.

babu
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.

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

2 follower(s)

Stats

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