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

Can we sort list in one2many field in SAAS

By
Atchuthan - Technical Consultant, Sodexis Inc
on 8/7/13, 9:14 AM 1,459 views
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

0

Ivan

--Ivan--
3210
| 5 3 6
Jakarta, Indonesia
--Ivan--
Ivan
On 3/31/15, 9:15 PM

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.

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

0 follower(s)

Stats

Asked: 8/7/13, 9:14 AM
Seen: 1459 times
Last updated: 3/31/15, 9:16 PM