top of page
  • Writer's pictureTek Siong, Hock

Odoo - Display partner in different name

Updated: Jan 30, 2021

There are times when you may want to have a unique short name for you customer when select it, but at the same time, may have to used the full name in the invoice report print out.

This Odoo technical development blog is my way to contribute back to the Odoo Community, for all the selfless and great sharing by the community members.

Click "Like" at the bottom of this blog, to motivate us to continue sharing more Odoo tips.

Replace the short name to the standard model's 'name'.

class ResPartner(models.Model):
    _inherit = "res.partner"
    short_name = fields.Char(string='Short Name')
    # Change the display name when user select partner
    def name_get(self):
        res = []
        for field in self:
            #name =
            if field.short_name:
                res.append((, '%s %s' % (field.short_name, '')))
            elif field.ref:
                res.append((, '%s %s' % (field.ref,
                res.append((, '%s %s' % ('',

        return res

Important to set the always_reload option.

<field name="customer_name" options='{"always_reload": True}'/>

488 views1 comment

Recent Posts

See All

Odoo with AI ChatGPT

Let the AI answer your questions based on your Odoo data

bottom of page