@app.teardown_appcontext
def close_db(error):
 if hasattr(g, 'sqlite_db'):
  g.sqlite_db.close()

@ app . teardown_appcontext def close_db ( error ) : if hasattr ( g , 'sqlite_db' ) : g . sqlite_db . close ( )
you might want to call odoo .