Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
def name_get(self, cr, uid, ids, context=None):
res = 
for record in self.browse(cr, uid, ids, context=context):
name = ''
if record.first_name or record.middle or record.last_name:
name = str(record.first_name)+ '/' + str(record.middle) + '/' + str(record.last_name)
Write a Selection function, and inside the function, build the Selection tuple in whichever way you needed.
Something this like
return [('option1', 'Option1'),
xyz_column = fields.Selection(selection=_get_xyz_selection, ...)
Create the fields
_inherit = 'res.partner'
_rec_name = 'full_name'
middle_name = fields.Char('Middle Name')
last_name = fields.Char('Last Name')
full_name = fields.Char(compute='_get_full_name')
Create Many2One field in another model
partner_id = fields.Many2one('res.partner', 'Partner')
<field name="partner_id"/><!-- It will display like dropdown box -->
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 platform 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.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 11/8/16, 1:13 AM|
|Seen: 212 times|
|Last updated: 11/9/16, 10:53 PM|