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

hello 

what is the use of browse method in odoo 15 ?



thank you in advance


아바타
취소

Browse method is used to get record set from database id or list of ids. In orders now you have record set of order [2,5,7] and you need to execute for loop to print data.

베스트 답변

Hi,

When you have an id or list of ids of an object and you have to get its record sets, you can use the browse orm method.

Suppose if you have list of id's of res.partner, lets says, partner_ids = [1,2,3] and if you need to get records, you can use browse method as follow:

partner_ids = [1,2,3]
partners = self.env['res.partner'].browse(partner_ids)

Result: res.partner(1,2,3)


See this video illustrating the same:https://www.youtube.com/watch?v=qgcGpdGCxeA

Thanks & Regards

아바타
취소
베스트 답변

You can use browse to get a list of records of the current module or if you specify the module then you can get records of the specified module

eg

self.browse(ids) // current table

self.env['res.company'].browse(company_id) // res_company table
아바타
취소
관련 게시물 답글 화면 활동
2
6월 22
2272
1
6월 25
1871
3
7월 25
3480
1
5월 25
1605
1
5월 25
1850