Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
8813 มุมมอง

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 ! 

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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

Sudhir Arya
ERP Harbor Consulting Services
skype: 
sudhir@erpharbor.com  website: http://www.erpharbor.com
อวตาร
ละทิ้ง
ผู้เขียน

Cool .. This is perfect... Works well

Thanks bro

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
มิ.ย. 15
4117
2
มิ.ย. 15
3685
3
ก.พ. 17
26497
0
ก.ย. 24
1253
dynamic domain in one2many แก้ไขแล้ว
2
พ.ค. 24
9233