Odoo Help


Difference between using cr param and ORM in any openerp class methods?

Abegail Sanchez
on 10/27/14, 4:29 AM 1,245 views

Is there any speed issue when using CR and ORM specially in querying records (e.g. getting all records in table)?

using cr:

*cr.execute('SELECT * FROM Table')

using ORM:

*self.search(cr,uid,[],context=None) or



Ludo - 21South

--Ludo - 21South--
| 2 2 5
Zwijndrecht, Netherlands
--Ludo - 21South--


Ludo - 21South
On 10/27/14, 4:54 AM

Not that I know of. Sometimes queries should perform better because you directly relate to the required fields and skip the other fields.

Do note however: Relational fields and fields using "store = false" will NOT show in the database. So if you run a query on the object, those fields will be impossible to retrieve. Therefor, the ORM has a slight advantage.

HAd some cases where lenght of domain is restricted to 256 characters... so ORM has a benefit of user acces rights check, and can read functional fields; while sql approach is better and faster for more complex data select... also much faster when taking big datasets on models ( 100k + records)

on 10/28/14, 5:43 AM

Tha't I've noticed on a transactional table specially in stock move model. I had thousands of records in the table and I need to get the quantity of products per location and I just wondering why too slow to query them. In fact qty available field in product model uses the same model but I noticed it is using CR approach so it came to my mind to post this kind of doubt.

Abegail Sanchez
on 10/28/14, 9:17 PM

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: 10/27/14, 4:29 AM
Seen: 1245 times
Last updated: 3/16/15, 8:10 AM