mirror of
https://github.com/OCA/reporting-engine.git
synced 2025-02-16 16:30:38 +02:00
[MIG] sql_request_abstract from 15.0 to 16.0
- Add new main entry menu for SQL configuration - Add abstract tree view - Add abstract form view - ADD ace/mode-pgsql.js file to have syntaxic coloration in sql field - move has_grouped_changed from bi_sql_editor to sql_request_abstract - remove main menu entries, replaced by new spreadsheet menu entries in V16 - update translation - IMP : inherit from mail.thread to use chatter - ADD : new note fields - REF : add comment on has_grouped_changed field
This commit is contained in:
1
sql_request_abstract/controllers/__init__.py
Normal file
1
sql_request_abstract/controllers/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import main
|
||||
29
sql_request_abstract/controllers/main.py
Normal file
29
sql_request_abstract/controllers/main.py
Normal file
@@ -0,0 +1,29 @@
|
||||
# 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,
|
||||
)
|
||||
Reference in New Issue
Block a user