跳至内容
菜单
此问题已终结

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

形象
丢弃
编写者

Thanks Waleed Mohsen its worked for me

最佳答案

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
形象
丢弃
相关帖文 回复 查看 活动
1
3月 24
4962
0
11月 19
4937
5
8月 19
11473
2
4月 24
17060
3
12月 23
7161