跳至內容
選單
此問題已被標幟
1 回覆
8811 瀏覽次數

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

相關帖文 回覆 瀏覽次數 活動
1
6月 15
4116
2
6月 15
3683
3
2月 17
26497
0
9月 24
1250
2
5月 24
9232