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()
-------------------------
Thank you so much. It worked.
most welcome
أنشئ حساباً اليوم لتستمتع بالخصائص الحصرية، وتفاعل مع مجتمعنا الرائع!
تسجيلالمنشورات ذات الصلة | الردود | أدوات العرض | النشاط | |
---|---|---|---|---|
|
2
أبريل 21
|
4810 | ||
How to solved this SQL error ??
تم الحل
|
|
1
سبتمبر 21
|
2420 | |
|
0
أكتوبر 21
|
1691 | ||
|
2
ديسمبر 23
|
30517 | ||
|
1
يونيو 15
|
17403 |