Skip to content

Commit

Permalink
[MIG] sql_request_abstract: Migration to 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
thienvh332 committed Nov 12, 2024
1 parent 0b59e05 commit a1f169c
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 19 deletions.
7 changes: 7 additions & 0 deletions sql_request_abstract/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
-----------
Expand Down
2 changes: 1 addition & 1 deletion sql_request_abstract/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 5 additions & 5 deletions sql_request_abstract/models/sql_request_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ def check_external_config(self):
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."
)
)

Expand Down Expand Up @@ -260,14 +260,14 @@ def _get_cr_for_query(self):
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:
Expand Down Expand Up @@ -300,7 +300,7 @@ def _check_prohibited_words(self):
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(
Expand Down
1 change: 1 addition & 0 deletions sql_request_abstract/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 change: 1 addition & 0 deletions sql_request_abstract/readme/CREDITS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The migration of this module from 17.0 to 18.0 was financially supported by Camptocamp.
6 changes: 6 additions & 0 deletions sql_request_abstract/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,14 @@ <h1>Contributors</h1>
<li>Alfadil Tabar (<a class="reference external" href="mailto:alfadil.tabar&#64;gmail.com">alfadil.tabar&#64;gmail.com</a>)</li>
<li>Helly kapatel &lt;<a class="reference external" href="mailto:helly.kapatel&#64;initos.com">helly.kapatel&#64;initos.com</a>&gt;</li>
<li>Nguyen Minh Chien &lt;<a class="reference external" href="mailto:chien&#64;trobz.com">chien&#64;trobz.com</a>&gt;</li>
<li>Vo Hong Thien &lt;<a class="reference external" href="mailto:thienvh&#64;trobz.com">thienvh&#64;trobz.com</a>&gt;</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>
Expand Down
2 changes: 0 additions & 2 deletions sql_request_abstract/static/src/js/code_editor.esm.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/** @odoo-module **/

import {CodeEditor} from "@web/core/code_editor/code_editor";
import {patch} from "@web/core/utils/patch";

Expand Down
17 changes: 6 additions & 11 deletions sql_request_abstract/views/view_sql_request_mixin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down Expand Up @@ -62,15 +61,15 @@ 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"
readonly="state != 'draft'"
widget="ace"
options="{'mode': 'pgsql'}"
/>
</group>
</group>
</page>
<page name="page_security" string="Security">
<group string="Allowed Groups" name="group_allowed_groups">
Expand All @@ -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>

0 comments on commit a1f169c

Please sign in to comment.