How to create a control field in OpenERP 6

I am trying to create a field from an OpenERP web gui and type the field as a link. 1st there is no better document about a link

2nd, what I want, when someone selects a field, he must give another choice that does not happen (although he gives some field, but the second field causes an error)!

It throws an object an error does not exist

+4
source share
1 answer

Reference fields are mainly used to display different model records as a link in your record. For example, you created such a model that when a sales order, purchase order, purchase order, etc. is created and saved, then a new record must be created in your model with data such as username, date, some notes. Thus, here you add a reference field that refers to the original record (sales order, purchase order, etc.) from which your record is created. You can find this in the res.request model in openerp 6

To create a reference field in your class

def _get_selection_list(self, cr, uid, context=None): #@return a list of tuples. tuples containing model name and name of the record model_pool = self.pool.get('ir.model') ids = model_pool.search(cr, uid, [('name','not ilike','.')]) res = model_pool.read(cr, uid, ids, ['model', 'name']) return [(r['model'], r['name']) for r in res] + [('','')] _columns = { 'ref': fields.reference(Reference', selection=_get_selection_list, size=128) } 
+7
source

All Articles