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.
In the new api, it's the field display_name. Just override the field display name to a computed one.
display_name = fields.Char(
names = [self.parent_id.name, self.name]
self.display_name = ' / '.join(filter(None, names))
I had some problems with this until I read this post by Martin Trigaux in the mailing list:
Perhaps is a good idea to update the docs.
Hello, Sorry to contradict you but it's actually still name_get that you should override. The initial intended behaviour was indeed to have display_name as replacement of name_get. However there were lot's of issues with the initial implementation and it was not backward compatible with the old api and we have to partially go back to old behaviour.
So the current behaviour of the name_get/display_name is the following:
name_get is still the main function used for rendering display_name is a computed field that will use name_get If you want to change both, you should still override name_get (see event for example).
Changing the method of display_name would affect only display_name, not name_get (can be what we want but usually not).
We may change one day to fully use display_name and drop name_get but that means breaking the backward-compatibility.
Hope it's clear.
Martin Trigaux Odoo (Formerly OpenERP)
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: 8/27/14, 4:13 AM|
|Seen: 5880 times|
|Last updated: 8/24/16, 3:00 AM|