Odoo Help


mean of cr param

on 7/25/14, 8:38 AM 1,119 views


what mean the param cr in some or all orm osv functions

thanks in advance

shashank verma
On 7/25/14, 11:33 AM

Hello Zouhair,

Cr means a "cursor"  which is the concept of SQL. The role of cursor(cr in Odoo) is to enumerate/iterate over each rows in result set one by one.
Hence cursor  act like a looping statement to fetch  data row by row basis

Enough of theory now , lets take an simple example of sql:

import psycopg2

conn = psycopg2.connect(database="mydb", user="postgres", password="postgres", host="", port="5432")

cur = conn.cursor()  #cursor object is created

cur.execute('''select name,date_order from sale.order''')

rows = cur.fetchall()




Clement Zotti
On 7/25/14, 11:02 AM

Hi, the cr parameters is a cursor to the database,

you can see the class here : https://github.com/odoo/odoo/blob/master/openerp/sql_db.py#L75.

As the class description says it's a wrapper around a psycopg cursor.

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: 7/25/14, 8:38 AM
Seen: 1119 times
Last updated: 3/16/15, 8:10 AM