Odoo Help

2

how to execute pgsql query in odoo to update a particular column from different table?

By
santhosh
on 11/24/14, 3:58 AM 2,528 views

Hi,

i want change the value of a column in particular table using pgsql query from different .py file example i want execute query of res.partner in main.py which is in web module.how can i do this any idea from you.

Can you help me...

Thanks in advance..

1

Hi,

In any where you can execute query if you get cursor (cr). So, in web module you can get the cursor using following way.

cr = request.session.cr

cr.execute("update res_partner set column1='value1' ")

I hope it is help to execute query in any where into openerp.

Thanks for you replay @Emipro Technologies i have one more question how to commit the query

santhosh
on 11/26/14, 4:53 AM

cr.commit() thats it.

Emipro Technologies Pvt. Ltd.
on 11/26/14, 6:12 AM

Again thanks @Emipro Technologies i want to do this update activity while restoring dump how can i do this. any idea

santhosh
on 11/27/14, 2:40 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.

Register

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)

Stats

Asked: 11/24/14, 3:58 AM
Seen: 2528 times
Last updated: 4/9/15, 8:19 AM