I tried to change the display name of the "res. partner" model by:
- Specifying the "_rec_name" in a class that I created which inherits "res. partner" of course.
- Override the "name_get" method as the following:
def name_get(self):
res = []
for partner in self:
name = partner.name
if partner.is_building:
name = partner.is_building
res.append((partner.id, name))
return res
It worked with the second solution but, when I click on the "save" button, the display name of the many2one field "partner_id" takes the value of the field "name" of "res. partner".