Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
13010 Prikazi

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

Avatar
Opusti

Can you explain your requirement in detail.

Best Answer

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

note=fields.text('Note')

note_create=prod_obj.write(cr,uid,[ids],{'note','=',prod_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())

Avatar
Opusti
Avtor

thanks shashank verma...!!!