콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다

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
5014
0
11월 19
4988
5
8월 19
11572
2
4월 24
17166
3
12월 23
7260