Files
odoo_source/addons/http_routing/controllers/main.py
T
Samuel Degueldre db7b485d98 [REF] web, website, *: make wowl services available in frontend
*: http_routing

When rewriting the webclient, a new environment was created, as well as
a new type of service and a new mechanism to start those services. This
environment and the services that go with it were not made available in
the frontend however.

This commit adapts the setup code for the frontend's root widget (and
the website specific equivalent, WebsiteRoot) so that the new
environment exists, and some of the calls to the legacy services are
redirected to the new services. The point is to allow removing some
legacy services whose code is currently only needed by the frontent
because of the lack of availability of this new env and services

Part of #72675
2021-07-14 07:34:16 +00:00

18 lines
641 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import http
from odoo.http import request
from odoo.addons.web.controllers.main import WebClient, Home
class Routing(Home):
@http.route('/website/translations/<string:unique>', type='http', auth="public", website=True)
def get_website_translations(self, unique, lang=None, mods=None):
IrHttp = request.env['ir.http'].sudo()
modules = IrHttp.get_translation_frontend_modules()
if mods:
modules += mods
return WebClient().translations(unique, mods=','.join(modules), lang=lang)