[MIG] base_external_dbsource: Migration to v15.0

TT37273
This commit is contained in:
Carlos Dauden
2022-08-30 16:28:04 +02:00
committed by Andrea Cattalani
parent afe106fcda
commit 1829a38b86
7 changed files with 37 additions and 27 deletions

View File

@@ -14,13 +14,13 @@ External Database Sources
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--backend-lightgray.png?logo=github
:target: https://github.com/OCA/server-backend/tree/14.0/base_external_dbsource
:target: https://github.com/OCA/server-backend/tree/15.0/base_external_dbsource
:alt: OCA/server-backend
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/server-backend-14-0/server-backend-14-0-base_external_dbsource
:target: https://translation.odoo-community.org/projects/server-backend-15-0/server-backend-15-0-base_external_dbsource
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/253/14.0
:target: https://runbot.odoo-community.org/runbot/253/15.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -75,7 +75,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-backend/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/server-backend/issues/new?body=module:%20base_external_dbsource%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/server-backend/issues/new?body=module:%20base_external_dbsource%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
@@ -95,8 +95,11 @@ Contributors
* Maxime Chambreuil <maxime.chambreuil@savoirfairelinux.com>
* Gervais Naoussi <gervaisnaoussi@gmail.com>
* Dave Lasley <dave@laslabs.com>
* Sergio Teruel <sergio.teruel@tecnativa.com> (https://wwww.tecnativa.com)
* Jairo Llopis <jairo.llopis@tecnativa.com> (https://wwww.tecnativa.com)
* `Tecnativa <https://www.tecnativa.com>`_:
* Sergio Teruel
* Jairo Llopis
Maintainers
~~~~~~~~~~~
@@ -111,6 +114,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
This module is part of the `OCA/server-backend <https://github.com/OCA/server-backend/tree/14.0/base_external_dbsource>`_ project on GitHub.
This module is part of the `OCA/server-backend <https://github.com/OCA/server-backend/tree/15.0/base_external_dbsource>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@@ -3,7 +3,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "External Database Sources",
"version": "14.0.1.0.1",
"version": "15.0.1.0.0",
"category": "Tools",
"author": "Daniel Reis, " "LasLabs, " "Odoo Community Association (OCA)",
"website": "https://github.com/OCA/server-backend",

View File

@@ -63,13 +63,12 @@ class BaseExternalDbsource(models.Model):
default=lambda self: self.env.user.company_id,
)
conn_string_full = fields.Text(readonly=True, compute="_compute_conn_string_full")
password = fields.Char("Password")
password = fields.Char()
client_cert = fields.Text()
client_key = fields.Text()
ca_certs = fields.Char(help="Path to CA Certs file on server.")
connector = fields.Selection(
CONNECTORS,
"Connector",
required=True,
help="If a connector is missing from the list, check the server "
"log to confirm that the required components were detected.",
@@ -151,12 +150,12 @@ class BaseExternalDbsource(models.Model):
try:
query = kwargs["sqlquery"]
except KeyError:
raise TypeError(_("query is a required argument"))
raise TypeError(_("query is a required argument")) from KeyError
if not execute_params:
try:
execute_params = kwargs["sqlparams"]
except KeyError:
pass
except KeyError as e:
_logger.debug(e)
method = self._get_adapter_method("execute")
rows, cols = method(query, execute_params, metadata)
@@ -179,7 +178,7 @@ class BaseExternalDbsource(models.Model):
raise ValidationError(
_("Connection test failed:\n" "Here is what we got instead:\n%s")
% tools.ustr(e)
)
) from e
raise ValidationError(
_("Connection test succeeded:\n" "Everything seems properly set up!")
)
@@ -330,7 +329,9 @@ class BaseExternalDbsource(models.Model):
except AttributeError:
raise NotImplementedError(
_(
'"%s" method not found, check that all assets are installed '
"for the %s connector type."
'"%(method)s" method not found, check that all assets are installed '
"for the %(connector)s connector type.",
method=method,
conector=self.connector,
)
) % (method, self.connector)
) from AttributeError

View File

@@ -2,5 +2,8 @@
* Maxime Chambreuil <maxime.chambreuil@savoirfairelinux.com>
* Gervais Naoussi <gervaisnaoussi@gmail.com>
* Dave Lasley <dave@laslabs.com>
* Sergio Teruel <sergio.teruel@tecnativa.com> (https://wwww.tecnativa.com)
* Jairo Llopis <jairo.llopis@tecnativa.com> (https://wwww.tecnativa.com)
* `Tecnativa <https://www.tecnativa.com>`_:
* Sergio Teruel
* Jairo Llopis

View File

@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils: http://docutils.sourceforge.net/" />
<title>External Database Sources</title>
<style type="text/css">
@@ -367,7 +367,7 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/server-backend/tree/14.0/base_external_dbsource"><img alt="OCA/server-backend" src="https://img.shields.io/badge/github-OCA%2Fserver--backend-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/server-backend-14-0/server-backend-14-0-base_external_dbsource"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/253/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/server-backend/tree/15.0/base_external_dbsource"><img alt="OCA/server-backend" src="https://img.shields.io/badge/github-OCA%2Fserver--backend-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/server-backend-15-0/server-backend-15-0-base_external_dbsource"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/253/15.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module allows you to define connections to foreign databases using ODBC,
Firebird, Oracle Client or SQLAlchemy.</p>
<p><strong>Table of contents</strong></p>
@@ -427,7 +427,7 @@ support larger datasets in a more efficient manner.</li>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/server-backend/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/server-backend/issues/new?body=module:%20base_external_dbsource%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/server-backend/issues/new?body=module:%20base_external_dbsource%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
@@ -446,8 +446,11 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<li>Maxime Chambreuil &lt;<a class="reference external" href="mailto:maxime.chambreuil&#64;savoirfairelinux.com">maxime.chambreuil&#64;savoirfairelinux.com</a>&gt;</li>
<li>Gervais Naoussi &lt;<a class="reference external" href="mailto:gervaisnaoussi&#64;gmail.com">gervaisnaoussi&#64;gmail.com</a>&gt;</li>
<li>Dave Lasley &lt;<a class="reference external" href="mailto:dave&#64;laslabs.com">dave&#64;laslabs.com</a>&gt;</li>
<li>Sergio Teruel &lt;<a class="reference external" href="mailto:sergio.teruel&#64;tecnativa.com">sergio.teruel&#64;tecnativa.com</a>&gt; (<a class="reference external" href="https://wwww.tecnativa.com">https://wwww.tecnativa.com</a>)</li>
<li>Jairo Llopis &lt;<a class="reference external" href="mailto:jairo.llopis&#64;tecnativa.com">jairo.llopis&#64;tecnativa.com</a>&gt; (<a class="reference external" href="https://wwww.tecnativa.com">https://wwww.tecnativa.com</a>)</li>
<li><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:<ul>
<li>Sergio Teruel</li>
<li>Jairo Llopis</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
@@ -457,7 +460,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/server-backend/tree/14.0/base_external_dbsource">OCA/server-backend</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/server-backend/tree/15.0/base_external_dbsource">OCA/server-backend</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>

View File

@@ -1,6 +1,6 @@
# Copyright 2016 LasLabs Inc.
import mock
from unittest import mock
from odoo.sql_db import connection_info_for
from odoo.tests import common

View File

@@ -6,7 +6,7 @@
<field name="model">base.external.dbsource</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="External DB Sources">
<tree>
<field name="name" />
<field name="connector" />
<field name="conn_string" />