The odoo.addons.web.controllers.main python module have been splitted over multiple files on the basis 1 controller = 1 file. In this work we adapt all modules to use the new imports. A non-exhaustive list of where stuff have been moved: * main.Home --> home.Home * main.Session --> session.Session * main.WebClient --> webclient.WebClient * main.clean_action --> action.clean_action * main.ensure_db --> home.ensure_db The complete list is accessible in odoo.addons.web.controllers.main. closes odoo/odoo#87571 Related: odoo/enterprise#25746 Signed-off-by: Raphael Collet <rco@odoo.com>
26 lines
955 B
Python
26 lines
955 B
Python
# 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.home import Home
|
|
from odoo.addons.web.controllers.session import Session
|
|
from odoo.addons.web.controllers.webclient import WebClient
|
|
|
|
|
|
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)
|
|
|
|
|
|
class SessionWebsite(Session):
|
|
|
|
@http.route('/web/session/logout', type='http', auth="none", website=True, multilang=False, sitemap=False)
|
|
def logout(self, redirect='/web'):
|
|
return super().logout(redirect=redirect)
|