Odoo Help


Data Retrieve from the Database

Dasadiya Chaitanya
on 1/22/14, 1:38 AM 4,446 views

How to Retrive the data from postgres sql and fill that data into text field in openerp ..? ? ? ?? ??

Can you explain your requirement in detail.

Gopakumar N G
on 1/22/14, 1:46 AM
shashank verma
On 1/22/14, 3:04 AM

Hi dasadiya

You can fetch records form postgresql table in 2ways 1. ORM methods 2. SQL queries

1.ORM method

prod_obj=self.pool.get(product.product) prod_name=prod_obj.browse(cr,uid,ids)[0].name

#this will return your product name



#this will insert product name into your text field.

2.using sql queries

cr.execute("select * from product_product where id =%s",ids) result=result = map(lambda x: x[0], cr.fetchall())

thanks shashank verma...!!!

Dasadiya Chaitanya
on 1/23/14, 12:59 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: 1/22/14, 1:38 AM
Seen: 4446 times
Last updated: 11/14/16, 6:54 AM