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.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
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.
query = "you query goes here"
request.cr.execute(query)
data = request.cr.fetchall()
-------------------------
Create an account today to enjoy exclusive features and engage with our awesome community!
Реєстрація| Related Posts | Відповіді | Переглядів | Дія | |
|---|---|---|---|---|
|
2
квіт. 21
|
6093 | |||
|
How to solved this SQL error ??
Вирішено
|
1
вер. 21
|
3848 | ||
|
0
жовт. 21
|
1691 | |||
|
2
груд. 23
|
32394 | |||
|
1
черв. 15
|
19352 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.