How can i show only 'name' in Many2one field with relation of res.partner?
By default it show 'display_name' that will return company name_contact name example: Tesla, Elon Musk
I want to remove company name by showing only 'name'
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
How can i show only 'name' in Many2one field with relation of res.partner?
By default it show 'display_name' that will return company name_contact name example: Tesla, Elon Musk
I want to remove company name by showing only 'name'
Hi Ricky Raymond,
There are multiple ways to set the name field into the display name for Many2one.
You can set _rec_name for that model, you can use name_get method to print name field only etc.
In your case, For Partner, base code displays the name in Many2one using some specific context into the name_get ( for partner model its _get_name).
Because your contact is a company, so that it use the _get_contact_name method and display the company, name as a Many2one partner name.
So for the Solution, you can override the "_get_contact_name" method and pass only name. It will solve your query.
Although for other, you can use the name_get method to set the name only.
Hope it will help you.
Hello
I have Odoo 17ee and studio, is there another way to do it with studio ?
Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!
Zarejestruj sięPowiązane posty | Odpowiedzi | Widoki | Czynność | |
---|---|---|---|---|
|
0
wrz 17
|
2845 | ||
|
0
wrz 24
|
1227 | ||
|
1
sty 24
|
1972 | ||
|
3
gru 23
|
1757 | ||
value from Many2one is None
Rozwiązane
|
|
1
lip 23
|
2214 |