Se rendre au contenu
Menu
Cette question a été signalée

Hi Community,

How can i change the default _rec_name of the model account.invoice using name_get or any other possible ways.How can i achieve this.I have tried inheriting the account.invoice and gave my new field as _rec_name but it dont works for me.

Thanks in advance

Avatar
Ignorer
Auteur

Thanks Waleed Mohsen its worked for me

Meilleure réponse

Hi, 

in COA, Let suppose you want to return account.code + ' ' + account.name rather than default name so you will override name_get method as below:

@api.multi
@api.depends('name', 'code')
def name_get(self):
result = []
for account in self:
name = account.code + ' ' + account.name
result.append((account.id, name))
return result
Avatar
Ignorer
Publications associées Réponses Vues Activité
1
mars 24
4984
0
nov. 19
4954
5
août 19
11506
2
avr. 24
17093
3
déc. 23
7205