Odoo Help


[SOLVED] How to override the display_name of a kanban (res.partner.kanban)?

Juan Formoso
on 10/14/14, 4:05 AM 2,627 views

I know that there are exactly the same question here:


But I tried the answers with no result. In the standard kanban view of a partner, if this one is a person, their name is shown as following:

company, name

If I check the code of the kanban view, I find the line which is showing the name:

<h4 class="oe_partner_heading"><a type="open"><field name="name"/></a></h4>

But why is showing the column display_name instead of name?

I tried to remove that, and I cannot, because, let's show my example:

This works, and shows the phone just after the display_name (why display_name??? I specified name):

<xpath expr="//kanban/templates//div//div/h4" position="replace">
     <h4><a type="open"><field name="name"/> <field name="phone"/></a></h4> ...

This does not work:

<xpath expr="//kanban/templates//div//div/h4" position="replace">
     <h4><a type="open"><field name="phone"/></a></h4> ...

It seems that if I remove the field name, it will not work. Anyone knows about this problem? How can I remove the name of the company in the kanban view if the partner is a person?


def name_get(self, cr, uid, ids, context=None):
        if context is None:
            context = {}
        if isinstance(ids, (int, long)):
            ids = [ids]
        res = []
        for record in self.browse(cr, uid, ids, context=context):
            name = record.name
            res.append((record.id, name))
        return res

Juan Formoso
On 10/14/14, 9:56 AM

I solved it (in my case, it was not necessary to override anything, only inherit from base.res_partner_kanban_view and modify the XML), in the next way:

                <xpath expr="//kanban/templates//div//div/h4" position="attributes">
                    <attribute name="invisible">1</attribute>
                <xpath expr="//kanban/templates//div//div/h4" position="after">
                    <h4 class="oe_partner_heading"><a type="open"><field name="name"/></a></h4>


Ludo - 21South

--Ludo - 21South--
| 2 2 5
Zwijndrecht, Netherlands
--Ludo - 21South--


Ludo - 21South
On 10/14/14, 5:23 AM

Find the appropriate "name_get" method on the object the kanban is view. This will most likely tell you how the name is returned when OpenERP searches for this object on the background.

Override the method and provide your own defintion to see if it changes.

I cannot manage this, I edited my post with the override of the python function.

Juan Formoso
on 10/14/14, 6:40 AM

It's a bit unclear for me. Are you unable to override the method, or are you unable to see any changes once the overridden method works?

21south, Ludo - 21South
on 10/14/14, 9:00 AM

@Ludo - Neobis the second one. But I have just found a way to manage what I want. Instead of using replace in the XML view, I made that tag invisible and write after that.

Juan Formoso
on 10/14/14, 9:48 AM

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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 10/14/14, 4:05 AM
Seen: 2627 times
Last updated: 3/16/15, 8:10 AM