I'm writing a controller for V7 and I have this problem. I want to get the database name and the cursor but I can't because there is no a "request" parameter like in V8 to get the cr value and I can't obtain database name from anywhere too. As you can see, I hardcoded the database name just for testing but I have to get it programatically or get the cursor value. How can I do that? Following, the actual code:
class firmaController(http.Controller):
_cp_path = '/x_firma'
@http.httprequest
def index(self, request, **post):
db_name = 'GRP-MRREE'
cr = openerp.pooler.get_db(db_name).cursor()
bd_obj = openerp.pooler.get_pool(db_name)
firma_obj = bd_obj.get('x_firma')
id_transaccion = post['id_transaction']
documento = firma_obj.invocar_ws_obtenerDocumentosFirmados(cr, SUPERUSER_ID, id_transaccion)
cr.commit()
cr.close()
return werkzeug.utils.redirect('/')
firmaController()
Hi Axel, I'm really new with openerp and particularly, with controllers. What do you mean with "authenticated sessions" and how can I do that? For what I've been doing with the debugger tool, request.session._db is coming with False value. Do you have any example how to implement authenticated sessions?
Authenticated sessions are those that needs a previous login on the specific database for the user