XML representation:
<button name="open_something" string="Name of button" type="object" />
Python Code:
@api.multi
def open_something(self):
self.ensure_one()
self.env.cr.execute("SQL query")
result = cr.fetchall()
...
Keep in mind that you must use ORM methods because some restrictions are not contained in the database.
source
share