Skip to Content
Menu
This question has been flagged

can i use sql query in my automated (user interface) action with odoo?

Avatar
Discard
Best Answer

Yes, if you select "execute python code", you can execute SQL in automated action as shown in an example:

https://ibb.co/tLpfjWn


Avatar
Discard
Best Answer
query = """
select * from your_table where id = """+str(self.id)+"""
"""
self.env.cr.execute(query)
data = self.env.cr.fetchone()



Avatar
Discard
Related Posts Replies Views Activity
1
Sep 21
2412
0
Oct 21
1691
2
Mar 18
9139
3
Dec 23
18228
0
May 24
557