Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
8471 Представления

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
Аватар
Отменить
Related Posts Ответы Просмотры Активность
1
мар. 24
4653
0
нояб. 19
4544
5
авг. 19
11118
2
апр. 24
16519
3
дек. 23
6671