Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
6392 มุมมอง
Is there any possibility of sorting the column in a one2many field.

Also can you provide me the location used to store one2many fields in OpenERP 7.0
For Eg: 
In CRM module, there is a child_ids in res.partner but it is not available at pgAdmin III.
I need to know where it is stored at Database level i.e. in pgAdmin III.

Thanks & Regards, Atchuthan

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

I can't answer the possibility of sorting of one2many fields.

However, for the other question, i.e where one2many fields are stored, the answer is "in the reverse many2one field".  When you define a one2many field you'll need specify a many2one field in the definition.  For res.partner's child_ids case, it is defined in doo/openerp/addons/base/res/res_partner.py.  The child_ids definition is:

'child_ids': fields.one2many('res.partner', 'parent_id', 'Contacts', domain=[('active','=',True)]),

So, the information is stored in the 'parent_id' field of res.partner model:

'parent_id': fields.many2one('res.partner', 'Related Company', select=True),

In order to search who are the 'child_ids' of Partner A, you'll need to search for all partners whose parent_id is Partner A.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
3
พ.ค. 25
1720
1
เม.ย. 25
1283
one2one relational field แก้ไขแล้ว
3
ก.ย. 24
14172
2
ก.พ. 24
2468
2
ส.ค. 23
21559