mirror of
https://github.com/OCA/reporting-engine.git
synced 2025-02-16 16:30:38 +02:00
[MIG] sql_request_abstract: Migration to 18.0
This commit is contained in:
@@ -124,6 +124,13 @@ Contributors
|
||||
- Alfadil Tabar (alfadil.tabar@gmail.com)
|
||||
- Helly kapatel <helly.kapatel@initos.com>
|
||||
- Nguyen Minh Chien <chien@trobz.com>
|
||||
- Vo Hong Thien <thienvh@trobz.com>
|
||||
|
||||
Other credits
|
||||
-------------
|
||||
|
||||
The migration of this module from 17.0 to 18.0 was financially supported
|
||||
by Camptocamp.
|
||||
|
||||
Maintainers
|
||||
-----------
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
{
|
||||
"name": "SQL Request Abstract",
|
||||
"version": "17.0.1.0.1",
|
||||
"version": "18.0.1.0.0",
|
||||
"author": "GRAP,Akretion,Odoo Community Association (OCA)",
|
||||
"maintainers": ["legalsylvain"],
|
||||
"website": "https://github.com/OCA/reporting-engine",
|
||||
|
||||
@@ -114,8 +114,8 @@ class SQLRequestMixin(models.AbstractModel):
|
||||
raise ValidationError(
|
||||
_(
|
||||
"You can't use an external database as there are no such "
|
||||
"configuration about this. Please contact your Odoo administrator"
|
||||
" to solve this issue."
|
||||
"configuration about this. Please contact "
|
||||
"your Odoo administrator to solve this issue."
|
||||
)
|
||||
)
|
||||
|
||||
@@ -260,14 +260,14 @@ class SQLRequestMixin(models.AbstractModel):
|
||||
def _create_savepoint(self, cr):
|
||||
rollback_name = "{}_{}".format(self._name.replace(".", "_"), uuid.uuid1().hex)
|
||||
# pylint: disable=sql-injection
|
||||
req = "SAVEPOINT %s" % (rollback_name)
|
||||
req = f"SAVEPOINT {rollback_name}"
|
||||
cr.execute(req)
|
||||
return rollback_name
|
||||
|
||||
@api.model
|
||||
def _rollback_savepoint(self, rollback_name, cr):
|
||||
# pylint: disable=sql-injection
|
||||
req = "ROLLBACK TO SAVEPOINT %s" % (rollback_name)
|
||||
req = f"ROLLBACK TO SAVEPOINT {rollback_name}"
|
||||
cr.execute(req)
|
||||
# close external database cursor
|
||||
if self.env.cr != cr:
|
||||
@@ -300,7 +300,7 @@ class SQLRequestMixin(models.AbstractModel):
|
||||
self.ensure_one()
|
||||
query = self.query.lower()
|
||||
for word in self.PROHIBITED_WORDS:
|
||||
expr = r"\b%s\b" % word
|
||||
expr = rf"\b{word}\b"
|
||||
is_not_safe = re.search(expr, query)
|
||||
if is_not_safe:
|
||||
raise UserError(
|
||||
|
||||
@@ -3,3 +3,4 @@
|
||||
- Alfadil Tabar (<alfadil.tabar@gmail.com>)
|
||||
- Helly kapatel \<<helly.kapatel@initos.com>\>
|
||||
- Nguyen Minh Chien \<<chien@trobz.com>\>
|
||||
- Vo Hong Thien \<<thienvh@trobz.com>\>
|
||||
|
||||
1
sql_request_abstract/readme/CREDITS.md
Normal file
1
sql_request_abstract/readme/CREDITS.md
Normal file
@@ -0,0 +1 @@
|
||||
The migration of this module from 17.0 to 18.0 was financially supported by Camptocamp.
|
||||
@@ -464,8 +464,14 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
|
||||
<li>Alfadil Tabar (<a class="reference external" href="mailto:alfadil.tabar@gmail.com">alfadil.tabar@gmail.com</a>)</li>
|
||||
<li>Helly kapatel <<a class="reference external" href="mailto:helly.kapatel@initos.com">helly.kapatel@initos.com</a>></li>
|
||||
<li>Nguyen Minh Chien <<a class="reference external" href="mailto:chien@trobz.com">chien@trobz.com</a>></li>
|
||||
<li>Vo Hong Thien <<a class="reference external" href="mailto:thienvh@trobz.com">thienvh@trobz.com</a>></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="other-credits">
|
||||
<h1>Other credits</h1>
|
||||
<p>The migration of this module from 17.0 to 18.0 was financially supported
|
||||
by Camptocamp.</p>
|
||||
</div>
|
||||
<div class="section" id="maintainers">
|
||||
<h1>Maintainers</h1>
|
||||
<p>This module is maintained by the OCA.</p>
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import {CodeEditor} from "@web/core/code_editor/code_editor";
|
||||
import {patch} from "@web/core/utils/patch";
|
||||
|
||||
|
||||
@@ -5,17 +5,16 @@ Copyright (C) 2022 - Today: GRAP (http://www.grap.coop)
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
-->
|
||||
<odoo>
|
||||
|
||||
<record id="view_sql_request_mixin_tree" model="ir.ui.view">
|
||||
<field name="model">sql.request.mixin</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree
|
||||
<list
|
||||
decoration-info="state=='draft'"
|
||||
decoration-warning="state in ('sql_valid', 'model_valid')"
|
||||
>
|
||||
<field name="name" />
|
||||
<field name="state" />
|
||||
</tree>
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -62,7 +61,7 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
<notebook>
|
||||
<page name="page_sql" string="SQL Settings">
|
||||
<group string="SQL Query" name="group_query">
|
||||
<field
|
||||
<field
|
||||
name="query"
|
||||
nolabel="1"
|
||||
colspan="2"
|
||||
@@ -70,7 +69,7 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
widget="ace"
|
||||
options="{'mode': 'pgsql'}"
|
||||
/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
<page name="page_security" string="Security">
|
||||
<group string="Allowed Groups" name="group_allowed_groups">
|
||||
@@ -96,13 +95,9 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
<div class="oe_chatter">
|
||||
<field name="message_follower_ids" />
|
||||
<field name="message_ids" />
|
||||
</div>
|
||||
<!-- Chatter -->
|
||||
<chatter />
|
||||
</form>
|
||||
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
|
||||
Reference in New Issue
Block a user