2
votes

If you install Openerp 7 with recruitment module. And create a simple entry with following values e.g.

Subject (internal field name = 'name') = 10 Year Experience

Applicant Name = Jhon Smith

Then if you create a custom module with following columns

_columns = {
   'applicant_id': fields.many2one('hr.applicant', 'Applicant', required=True),
}

The view widget by default will show a drop-down with the Subject (internal field name ='name') field but i want to show applicant name (internal field name='partner_name') field in drop down, when creating a new record in my custom module.

In Summary how can I display Applicant's Name instead of Subject in drop-down widget in my custom module.

2

2 Answers

0
votes

In openerp there is a function called name_get().This function returns a list of tuples containing ID of the record and name tobe displayed. So override this function and return list of tuples containing ID of the record and applicant name

0
votes

You need to define applicant_id in _rec_name in your custom module.

Try this:

_rec_name = 'applicant_id'

Have a look at Predefined fields.