CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I have Openeducat ERP installed in Odoo 8 on a Windows 2008 R2 server.
Students in Operneducat have three fields for their names: Name, Middle Name and Last Name
When I want to issue and invoice for a student, in the Customer field I only see the value for the "Name" field. I would like to change the view to show both "Name" and "Last Name" as a concatenated string in the drop-down list.
How can I achieve this?
In odoo version 8, the display name is by default the value of the 'name' field or the value of the field specified by _rec_name. To customize this, you need to override the name_get method in the op.student model as follows:
_inherit = 'op.student' def name_get(self, cr, uid, ids, context=None):
if not len(ids):
res = [(r['id'], r['name'] and '%s %s' % (r['name'], r['last_name']) or r['name'] ) for r in self.read(cr, uid, ids, ['name', 'last_name'], context=context) ]
You will obviously need to create a custom module to achieve this. I hope that helps.
About This Community
Odoo Training Center
|Asked: 2/1/16, 11:01 AM|
|Seen: 686 times|
|Last updated: 2/3/16, 9:40 AM|