Skip to Content
मेन्यू
This question has been flagged
3 Replies
12773 Views

How to execute sql query on website controller?


I need to get data from a many2many field:

my code:

        self.env.execute('SELECT * from customer_ids')

        res = self.env.fetchall()

     

But this doesn't work in the controllers. Hope you can help me. Thank you.


Avatar
Discard
Best Answer
query = "you query goes here"    
request.cr.execute(query)   
data = request.cr.fetchall() 
-------------------------
Avatar
Discard
Author

Thank you so much. It worked.

most welcome

Related Posts Replies Views Activity
2
अप्रैल 21
5350
1
सित॰ 21
2966
0
अक्तू॰ 21
1691
2
दिस॰ 23
31333
1
जून 15
18213