Skip to content

Commit

Permalink
[MIG] base_external_dbsource: Migration to 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
HviorForgeFlow committed Jan 16, 2025
1 parent fd1ce70 commit ad8acad
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions base_external_dbsource/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "External Database Sources",
"version": "17.0.1.0.0",
"version": "18.0.1.0.0",
"category": "Tools",
"author": "Daniel Reis, " "LasLabs, " "Odoo Community Association (OCA)",
"author": "Daniel Reis, LasLabs, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/server-backend",
"license": "LGPL-3",
"images": ["images/screenshot01.png"],
Expand Down
2 changes: 1 addition & 1 deletion base_external_dbsource/models/base_external_dbsource.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def _compute_conn_string_full(self):
if "%s" not in record.conn_string:
pwd_string = getattr(
record,
"PWD_STRING_%s" % record.connector.upper(),
f"PWD_STRING_{record.connector.upper()}",
record.PWD_STRING,
)
record.conn_string += pwd_string
Expand Down
4 changes: 2 additions & 2 deletions base_external_dbsource/tests/test_base_external_dbsource.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def _test_adapter_method(
args = []

Check warning on line 42 in base_external_dbsource/tests/test_base_external_dbsource.py

View check run for this annotation

Codecov / codecov/patch

base_external_dbsource/tests/test_base_external_dbsource.py#L42

Added line #L42 was not covered by tests
if kwargs is None:
kwargs = {}
adapter = "%s_postgresql" % method_name
adapter = f"{method_name}_postgresql"
with mock.patch.object(type(self.dbsource), adapter, create=create) as adapter:
if side_effect is not None:
adapter.side_effect = side_effect

Check warning on line 48 in base_external_dbsource/tests/test_base_external_dbsource.py

View check run for this annotation

Codecov / codecov/patch

base_external_dbsource/tests/test_base_external_dbsource.py#L48

Added line #L48 was not covered by tests
Expand All @@ -55,7 +55,7 @@ def test_conn_string_full(self):
"""It should add password if string interpolation not detected"""
self.dbsource.conn_string = "User=Derp;"
self.dbsource.password = "password"
expect = self.dbsource.conn_string + "PWD=%s;" % self.dbsource.password
expect = f"{self.dbsource.conn_string}PWD={self.dbsource.password};"
self.assertEqual(self.dbsource.conn_string_full, expect)

self.dbsource.conn_string = "User=Derp;"
Expand Down
10 changes: 5 additions & 5 deletions base_external_dbsource/views/base_external_dbsource.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
<odoo>
<!-- DBSource -->
<record model="ir.ui.view" id="view_dbsource_tree">
<field name="name">base.external.dbsource.tree</field>
<field name="name">base.external.dbsource.list</field>
<field name="model">base.external.dbsource</field>
<field name="type">tree</field>
<field name="type">list</field>
<field name="arch" type="xml">
<tree>
<list>
<field name="name" />
<field name="connector" />
<field name="conn_string" />
</tree>
</list>
</field>
</record>
<record model="ir.ui.view" id="view_dbsource_form">
Expand Down Expand Up @@ -56,7 +56,7 @@
<record model="ir.actions.act_window" id="action_dbsource">
<field name="name">External Database Sources</field>
<field name="res_model">base.external.dbsource</field>
<field name="view_mode">tree,form</field>
<field name="view_mode">list,form</field>
<field name="view_id" ref="view_dbsource_tree" />
</record>
<menuitem
Expand Down

0 comments on commit ad8acad

Please sign in to comment.