Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
8786 Visualizzazioni

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
Abbandona
Autore

Thanks Waleed Mohsen its worked for me

Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
mar 24
4973
0
nov 19
4946
5
ago 19
11491
2
apr 24
17077
3
dic 23
7188