[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:
Sylvain LE GAL
2022-10-25 22:36:46 +02:00
committed by thien
parent 5c876f8f8a
commit 2645c5c394
12 changed files with 1930 additions and 42 deletions

View File

@@ -0,0 +1 @@
from . import main

View 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,
)