Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Property Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

How to select multiple products in one2many field ?

Subscribe

Get notified when there's activity on this post

This question has been flagged
10 Replies
20000 Views
Avatar
babu

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.

0
Avatar
Discard
Baiju KS

can you please explain your use of that field??

babu
Author

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.

OdooBot
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 ?
Avatar
Baiju KS
Best Answer

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

 

3
Avatar
Discard
babu
Author

Thanks Baiju, but my question is different.

Avatar
Muhammad Bilal
Best Answer

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://apps.odoo.com/apps/modules/9.0/web_x2many_selectable/

3
Avatar
Discard
Avatar
Deepa Venkatesh
Best Answer

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
Avatar
Discard
Avatar
Rajiv
Best Answer

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.

0
Avatar
Discard
babu
Author

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.

Rajiv

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.

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk Slovenščina Español (América Latina) Español Svenska ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now