Files
tess_admin 28d9e56f47 🎉 Initial commit - Hazard Odoo 16 project
- Custom modules: hazard_shopify, hazard_inventory_report, hazard_website
- Third-party modules: bi_sql_editor, query_deluxe, sql_request_abstract, l10n_mx_sat_sync_itadmin_ee
- Docker setup: Odoo 16 + PostgreSQL 17
- Utility scripts: backup_hazard.sh, update_module.py
- Agent configuration: .agents/AGENTS.md
- Security: Enterprise modules, credentials, backups and production data excluded via .gitignore
2026-06-30 06:12:35 -06:00

30 lines
1.1 KiB
Python

# Part of Odoo. See LICENSE file for full copyright and licensing details.
import werkzeug
from odoo import http
from odoo.http import request
from odoo.tools.misc import file_open
from odoo.addons.web.controllers.webclient import WebClient
class SqlRequestAbstractWebClient(WebClient):
# if a field, widget="ace" option="{'mode': 'xxx'}"
# is present, The ace lib (odoo/addons/web/static/lib/ace)
# will generate a call to /web/static/lib/ace/mode-xxx.js
# to load the javascript syntax file.
# We catch this call and redirect on the correct path
@http.route("/web/static/lib/ace/mode-pgsql.js", type="http", auth="none")
def call_mode_pgsql_file(self):
return http.Response(
werkzeug.wsgi.wrap_file(
request.httprequest.environ,
file_open("sql_request_abstract/static/lib/ace/mode-pgsql.js", "rb"),
),
content_type="application/javascript; charset=utf-8",
headers=[("Cache-Control", f"max-age={http.STATIC_CACHE}")],
direct_passthrough=True,
)