Odoo Help


for order in self.browse(cr, uid, ids, context=context), what self.browse does?

on 2/8/16, 7:22 PM 2,824 views

I am extending sale.order. I have noticed that in order to gather the object in the old api you can do:

for order in self.browse(cr, uid, ids, context=context):

I would like to know what self.browse does, and why do I have to iterate over it.


Axel Mendoza

--Axel Mendoza--
| 7 8 8
Camaguey, Cuba
--Axel Mendoza--

DevOps - Full stack - Software Architect - Developer - Technology Integrator

I could help you to develop anything and solve complex problems based on technologies, integrations and tricky stuffs mostly in Python with OpenERP/Odoo, Zato, Django and many others frameworks programming languages and technologies.

I offers consulting services to anyone with an unanswered questions or needs for customizations. Think about it, maybe it's better to have an expert to solve your issues and projects than having a full-time employee trying to understand what to do and how

Reach me at aekroft@gmail.com

Axel Mendoza
On 2/8/16, 9:12 PM

I think that you will find extremelly helpful the entire read of this page


It will clarify you a lot of stuff related with the development of Odoo models, I was using the old api for a long time and to jump into the new api I just read very carefully that page. At the end there is the "Porting from the old API to the new API" topic that also bring some light to the use of the two api versions

I have read it throughly, it clarified. Still not mastering when old and new api are mixed.

on 2/9/16, 10:55 AM

The old api and the new api differs in the use of the arguments cr. uid, ids, context, in the return of the methods. When the new api manage recordsets, in the old api you manage everything. Think the new api as using Active Records while the old api you call the methods to get the values even when the browse_record class acts a little as an Active Record in the old api. The browse in the new api and the old api only differs in that for the new api the arguments cr, uid and context are not needed since they are retrieved from the Environment attached to self

Axel Mendoza
on 2/9/16, 4:38 PM
Samantha Cruz
On 2/8/16, 7:37 PM


 as a sql, it select records by Id. Note if you pass a browse an integer you get a single browse record, if you pass a list of ids you get a list of browse records.

Note that browse() doesn't actually do the query; it just creates the objects. Only when you access an attribute of one of the objects does it actually query the database.

André Pereira
on 2/9/16, 5:31 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 2/8/16, 7:22 PM
Seen: 2824 times
Last updated: 8/13/17, 10:11 AM