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


I have no problems using the search method with sudo but  the browse method gives no result.

search_objs =  env['res.partner'].sudo(user.id).search([])
browse_objs = env['res.partner'].sudo(user.id).browse([])
assert len(search_objs) = len(browse_objs)


Is this result difference intended ?

Is this only happening to my configuration ? .

Do you experience the same ?

아바타
취소
베스트 답변

Hi Yurdik

Using sudo with browse is not the problem, the issue is that browse receive always a an id or a list of ids to browse. As opposite to search that receive a domain that could be empty the browse method really need the ids to retrieve the results. If you pass a list of ids to the browse you could make the asserts works, like:

search_objs =  env['res.partner'].sudo(user.id).search([])
browse_objs = env['res.partner'].sudo(user.id).browse(search_objs)
assert len(search_objs) = len(browse_objs)# ok
아바타
취소
작성자

I did forget that. :-) I do work a lot with erppeek, and erppeek allows to specify the search_domain also in browse. Thanks a lot.

관련 게시물 답글 화면 활동
1
12월 23
20992
0
11월 16
2917
Using search count 해결 완료
2
12월 23
20085
2
3월 15
8376
2
10월 15
9133