Skip to Content
Menu
This question has been flagged
1 Reply
13369 Views
browse()

Takes a database id or a list of ids and returns a recordset.

Hi all , this is the meaning of function browse. I try to print data using function browse but why it always print record in order ?
Ex:

print(self.browser([2, 5, 7]))

but result always 2 , 5, 7 if it is set it should not in order 


Thank in advances



Avatar
Discard
Best Answer

Hello @sambath,

Browse method is used to get record set from database id or list of ids. 

Here in example, you are trying to get record set for id = [2,5,7]

(I assume here self means sale.order)

orders = self.browse([2,5,7])

In orders now you have record set of order [2,5,7] and you need to execute for loop to print data.

Like,

for order in orders:

print order.name #Here ypu can print any field from Sale order.

Let me know if you have any query.

If you are satisfied with my answer then can you please mark this as resolved.

Regards,




Email: odoo@aktivsoftware.com

Skype: kalpeshmaheshwari

   

Avatar
Discard