如何使用 odoo 中的参数从一个控制器重定向到另一个控制器?
How to redirect from one controller to another with params in odoo?
我已经为新用户创建了一个注册页面,company.I不想使用已经存在的默认注册页面,因为我有很多自定义字段。创建新用户和公司后,我想在新页面中显示用户详细信息。我收到错误 TypeError: 'dict' object is not callable
。如何使用我的参数 'qcontext'.
从“/web/save”api 重定向到“/web/details”api
@http.route('/web/save', type='http', method="post", auth="public",csrf=False)
def save_registration_details(self, **kw):
qcontext = request.params.copy()
# Code to create new user and company
return {
'type': 'ir.actions.act_url',
'url': '/web/details/%s' % qcontext,
'target': 'self',
}
@http.route('/web/details', type='http', auth="public")
def show_registration_details(self, qcontext, redirect=None, **kw):
return http.request.render('odoo_web_login.success',qcontext)
你可以试试:
return werkzeug.utils.redirect('/web/details%s' % qcontext)
从一个控制器重定向到另一个控制器 return url 像这样:
return {
'type': 'ir.actions.act_url',
'url': '/web/details?qcontext=%s&redirect=True' % (qcontext),
'target': 'self',
}
我已经为新用户创建了一个注册页面,company.I不想使用已经存在的默认注册页面,因为我有很多自定义字段。创建新用户和公司后,我想在新页面中显示用户详细信息。我收到错误 TypeError: 'dict' object is not callable
。如何使用我的参数 'qcontext'.
@http.route('/web/save', type='http', method="post", auth="public",csrf=False)
def save_registration_details(self, **kw):
qcontext = request.params.copy()
# Code to create new user and company
return {
'type': 'ir.actions.act_url',
'url': '/web/details/%s' % qcontext,
'target': 'self',
}
@http.route('/web/details', type='http', auth="public")
def show_registration_details(self, qcontext, redirect=None, **kw):
return http.request.render('odoo_web_login.success',qcontext)
你可以试试:
return werkzeug.utils.redirect('/web/details%s' % qcontext)
从一个控制器重定向到另一个控制器 return url 像这样:
return {
'type': 'ir.actions.act_url',
'url': '/web/details?qcontext=%s&redirect=True' % (qcontext),
'target': 'self',
}