Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
8815 Zobrazení

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
Zrušit
Autor

Thanks Waleed Mohsen its worked for me

Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
bře 24
4986
0
lis 19
4955
5
srp 19
11507
2
dub 24
17100
3
pro 23
7205