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

Display One2many field multiple time in same form

By
nishad
on 8/21/16, 1:30 AM 394 views

How to show a One2many field values multiple time in same form in Odoo.

It require to show the same value in multiple tab in a form but with different domain.

Is it  possible to achieve this ? If not what is the best alternative for achieving the same ?

Any thought on this is appreciated ! 

0

Sudhir Arya (SA)

--Sudhir Arya (SA)--
10150
| 6 8 8
Ahmedabad, India
--Sudhir Arya (SA)--

Working as an OpenERP/Odoo developer and a Team Leader 

Top 5 Odoo contributor On Stackoverflow

LinkedIn

Blog

Stackoverflow

Sudhir Arya (SA)
On 8/21/16, 11:42 AM

Hi Nishad,

It's way simple than you are thinking. You just have to create multiple one2many fields with different field names and add the domain according to your need.

Reference: MRP

Ex:

draft_lines = fields.One2many('my_obj.obj', 'my_obj_id', domain=[('state', '=', 'draft')], 'Draft Lines')
confirmed_lines = fields.One2many('my_obj.obj', 'my_obj_id', domain=[('state', '=', 'confirm')], 'Confirmed Lines')
cancelled_lines = fields.One2many('my_obj.obj', 'my_obj_id', domain=[('state', '=', 'cancel')], 'Cancelled Lines')

Cool .. This is perfect... Works well

nishad
on 8/22/16, 1:54 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)

Stats

Asked: 8/21/16, 1:30 AM
Seen: 394 times
Last updated: 8/22/16, 1:53 AM