Files
odoo_source/addons/http_routing/models/ir_qweb.py
T
Julien Castiaux 5ced646b3f [FIX] auth_signup: impossible to login
Install auth_signup, go to /web/login, 500 Internal Server Error.

auth_signup extends the /web/login template and in this extension calls
`keep_query()` which has been wrongly moved from base to http_routing in
commit 880954ebfc. Here, we restored `keep_query()` in the base module
but moved in ir_qweb.

closes odoo/odoo#87491

Related: odoo/enterprise#25754
Signed-off-by: Julien Castiaux <juc@odoo.com>
2022-03-30 17:35:06 +02:00

25 lines
753 B
Python

# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
from odoo.http import request
from odoo.addons.http_routing.models.ir_http import slug, unslug_url, url_for
class IrQweb(models.AbstractModel):
_inherit = "ir.qweb"
def _prepare_environment(self, values):
irQweb = super()._prepare_environment(values)
values['slug'] = slug
values['unslug_url'] = unslug_url
if (not irQweb.env.context.get('minimal_qcontext') and
request and request.is_frontend):
return irQweb._prepare_frontend_environment(values)
return irQweb
def _prepare_frontend_environment(self, values):
values['url_for'] = url_for
return self