CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I saw this code segment in subscription.py class. It gives selection and many2one fields together for users. I found in openerp documentation and another modules also but i never found any details or other samples for this
here is the its view
here is the code related to that field
'doc_source': fields.reference('Source Document', required=True, selection=_get_document_types, size=128),
here is the selection part function code
def _get_document_types(self, cr, uid, context=None): cr.execute('select m.model, s.name from subscription_document s, ir_model m WHERE s.model = m.id order by s.name') return cr.fetchall()
I Need to know that; can we make our own fields.reference type fields.?
another combination instead of MODEL,NAME..?
About This Community
Odoo Training Center
|Asked: 8/7/13, 2:28 AM|
|Seen: 6945 times|
|Last updated: 2/6/17, 8:19 AM|