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

I tried to get the ref value from an other module with that:

self.pool.get('hr.payslip')

How can I get the value of the ref in hr.payslip?

아바타
취소
베스트 답변

dear Wizardz,

 your question is not clear, but if i understand you can get the data by call the browse method that receive id or list of ids you can got by using search method.

then when you browse the record or records you can get any value of any fields of that object by using dotted notation.

I hope I helped you.

 
아바타
취소
작성자

how is this browse function working ?

firstly you can make object if you need to get data from other module

model_obj= self.pool.get('your model')

secondly if you know the id you can directly call browse record:

record= model_obj.browse(cr, uid, your id, context=context)

then record. any field.

if you can not know the id you can make search :

rec_ids= model_obj.search(cr, uid, [('your field','comparison',value)], context=context)

this mean [('your field','comparison',value)] your domain

for record in model_obj.browse(cr, uid, rec_ids, context=contect)

record. any fields

I hope i helped you...

관련 게시물 답글 화면 활동
0
4월 24
1948
4
11월 23
6046
0
10월 23
1796
0
12월 22
2692
2
12월 23
19463