From 8893d9c815e1d13c74d98dedd16cb6e8cc914a7a Mon Sep 17 00:00:00 2001 From: Anxo82 Date: Wed, 5 Jun 2024 13:50:00 +0200 Subject: [PATCH] [IMP] base_external_dbsource: pre-commit auto fixes --- base_external_dbsource/README.rst | 72 +++++++++---------- .../models/base_external_dbsource.py | 2 +- base_external_dbsource/pyproject.toml | 3 + base_external_dbsource/readme/CONFIGURE.md | 4 ++ base_external_dbsource/readme/CONFIGURE.rst | 4 -- base_external_dbsource/readme/CONTRIBUTORS.md | 8 +++ .../readme/CONTRIBUTORS.rst | 10 --- .../{DESCRIPTION.rst => DESCRIPTION.md} | 4 +- .../readme/{INSTALL.rst => INSTALL.md} | 0 base_external_dbsource/readme/ROADMAP.md | 9 +++ base_external_dbsource/readme/ROADMAP.rst | 8 --- base_external_dbsource/readme/USAGE.md | 6 ++ base_external_dbsource/readme/USAGE.rst | 7 -- .../static/description/index.html | 36 +++++----- 14 files changed, 89 insertions(+), 84 deletions(-) create mode 100644 base_external_dbsource/pyproject.toml create mode 100644 base_external_dbsource/readme/CONFIGURE.md delete mode 100644 base_external_dbsource/readme/CONFIGURE.rst create mode 100644 base_external_dbsource/readme/CONTRIBUTORS.md delete mode 100644 base_external_dbsource/readme/CONTRIBUTORS.rst rename base_external_dbsource/readme/{DESCRIPTION.rst => DESCRIPTION.md} (54%) rename base_external_dbsource/readme/{INSTALL.rst => INSTALL.md} (100%) create mode 100644 base_external_dbsource/readme/ROADMAP.md delete mode 100644 base_external_dbsource/readme/ROADMAP.rst create mode 100644 base_external_dbsource/readme/USAGE.md delete mode 100644 base_external_dbsource/readme/USAGE.rst diff --git a/base_external_dbsource/README.rst b/base_external_dbsource/README.rst index 80e3754c..1819b140 100644 --- a/base_external_dbsource/README.rst +++ b/base_external_dbsource/README.rst @@ -17,19 +17,19 @@ 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/16.0/base_external_dbsource + :target: https://github.com/OCA/server-backend/tree/17.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-16-0/server-backend-16-0-base_external_dbsource + :target: https://translation.odoo-community.org/projects/server-backend-17-0/server-backend-17-0-base_external_dbsource :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png - :target: https://runboat.odoo-community.org/builds?repo=OCA/server-backend&target_branch=16.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/server-backend&target_branch=17.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| -This module allows you to define connections to foreign databases using ODBC, -Firebird, Oracle Client or SQLAlchemy. +This module allows you to define connections to foreign databases using +ODBC, Firebird, Oracle Client or SQLAlchemy. **Table of contents** @@ -46,31 +46,32 @@ Configuration To configure this module, you need to: -#. Database sources can be configured in Settings > Technical > - Database Structure > Data sources. +1. Database sources can be configured in Settings > Technical > Database + Structure > Data sources. Usage ===== -* Go to Settings > Technical > Database Structure > Database Sources -* Click on Create to enter the following information: - -* Data source name  -* Password -* Connector: Choose the database to which you want to connect -* Connection string: Specify how to connect to database +- Go to Settings > Technical > Database Structure > Database Sources +- Click on Create to enter the following information: +- Data source name  +- Password +- Connector: Choose the database to which you want to connect +- Connection string: Specify how to connect to database Known issues / Roadmap ====================== -* Find a way to remove or default the CA certs dir -* Add concept of multiple connection strings for one source (multiple nodes) -* Add a ConnectionEnvironment that allows for the reuse of connections -* Message box should be displayed instead of error in ``connection_test`` -* Remove old api compatibility layers (v11) -* Instead of returning list of results, we should return iterators. This will - support larger datasets in a more efficient manner. -* Implement better CRUD handling +- Find a way to remove or default the CA certs dir +- Add concept of multiple connection strings for one source (multiple + nodes) +- Add a ConnectionEnvironment that allows for the reuse of connections +- Message box should be displayed instead of error in + ``connection_test`` +- Remove old api compatibility layers (v11) +- Instead of returning list of results, we should return iterators. + This will support larger datasets in a more efficient manner. +- Implement better CRUD handling Bug Tracker =========== @@ -78,7 +79,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -86,27 +87,26 @@ Credits ======= Authors -~~~~~~~ +------- * Daniel Reis * LasLabs Contributors -~~~~~~~~~~~~ +------------ -* Daniel Reis -* Maxime Chambreuil -* Gervais Naoussi -* Dave Lasley +- Daniel Reis +- Maxime Chambreuil +- Gervais Naoussi +- Dave Lasley +- `Tecnativa `__: -* `Tecnativa `_: - - * Sergio Teruel - * Jairo Llopis - * Andrea Cattalani (`Moduon `__) + - Sergio Teruel + - Jairo Llopis + - Andrea Cattalani (`Moduon `__) Maintainers -~~~~~~~~~~~ +----------- This module is maintained by the OCA. @@ -118,6 +118,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 `_ project on GitHub. +This module is part of the `OCA/server-backend `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/base_external_dbsource/models/base_external_dbsource.py b/base_external_dbsource/models/base_external_dbsource.py index 78a652da..114dc48d 100644 --- a/base_external_dbsource/models/base_external_dbsource.py +++ b/base_external_dbsource/models/base_external_dbsource.py @@ -322,7 +322,7 @@ class BaseExternalDbsource(models.Model): """ self.ensure_one() - method = "{}_{}".format(method_prefix, self.connector) + method = f"{method_prefix}_{self.connector}" try: return getattr(self, method) diff --git a/base_external_dbsource/pyproject.toml b/base_external_dbsource/pyproject.toml new file mode 100644 index 00000000..4231d0cc --- /dev/null +++ b/base_external_dbsource/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/base_external_dbsource/readme/CONFIGURE.md b/base_external_dbsource/readme/CONFIGURE.md new file mode 100644 index 00000000..01fc514c --- /dev/null +++ b/base_external_dbsource/readme/CONFIGURE.md @@ -0,0 +1,4 @@ +To configure this module, you need to: + +1. Database sources can be configured in Settings \> Technical \> + Database Structure \> Data sources. diff --git a/base_external_dbsource/readme/CONFIGURE.rst b/base_external_dbsource/readme/CONFIGURE.rst deleted file mode 100644 index a48ca1e1..00000000 --- a/base_external_dbsource/readme/CONFIGURE.rst +++ /dev/null @@ -1,4 +0,0 @@ -To configure this module, you need to: - -#. Database sources can be configured in Settings > Technical > - Database Structure > Data sources. diff --git a/base_external_dbsource/readme/CONTRIBUTORS.md b/base_external_dbsource/readme/CONTRIBUTORS.md new file mode 100644 index 00000000..95c3e374 --- /dev/null +++ b/base_external_dbsource/readme/CONTRIBUTORS.md @@ -0,0 +1,8 @@ +- Daniel Reis \<\> +- Maxime Chambreuil \<\> +- Gervais Naoussi \<\> +- Dave Lasley \<\> +- [Tecnativa](https://www.tecnativa.com): + - Sergio Teruel + - Jairo Llopis + - Andrea Cattalani ([Moduon](https://www.moduon.team/)) diff --git a/base_external_dbsource/readme/CONTRIBUTORS.rst b/base_external_dbsource/readme/CONTRIBUTORS.rst deleted file mode 100644 index a0e67956..00000000 --- a/base_external_dbsource/readme/CONTRIBUTORS.rst +++ /dev/null @@ -1,10 +0,0 @@ -* Daniel Reis -* Maxime Chambreuil -* Gervais Naoussi -* Dave Lasley - -* `Tecnativa `_: - - * Sergio Teruel - * Jairo Llopis - * Andrea Cattalani (`Moduon `__) diff --git a/base_external_dbsource/readme/DESCRIPTION.rst b/base_external_dbsource/readme/DESCRIPTION.md similarity index 54% rename from base_external_dbsource/readme/DESCRIPTION.rst rename to base_external_dbsource/readme/DESCRIPTION.md index b6beb1c1..7b63db0d 100644 --- a/base_external_dbsource/readme/DESCRIPTION.rst +++ b/base_external_dbsource/readme/DESCRIPTION.md @@ -1,2 +1,2 @@ -This module allows you to define connections to foreign databases using ODBC, -Firebird, Oracle Client or SQLAlchemy. +This module allows you to define connections to foreign databases using +ODBC, Firebird, Oracle Client or SQLAlchemy. diff --git a/base_external_dbsource/readme/INSTALL.rst b/base_external_dbsource/readme/INSTALL.md similarity index 100% rename from base_external_dbsource/readme/INSTALL.rst rename to base_external_dbsource/readme/INSTALL.md diff --git a/base_external_dbsource/readme/ROADMAP.md b/base_external_dbsource/readme/ROADMAP.md new file mode 100644 index 00000000..60d4873b --- /dev/null +++ b/base_external_dbsource/readme/ROADMAP.md @@ -0,0 +1,9 @@ +- Find a way to remove or default the CA certs dir +- Add concept of multiple connection strings for one source (multiple + nodes) +- Add a ConnectionEnvironment that allows for the reuse of connections +- Message box should be displayed instead of error in `connection_test` +- Remove old api compatibility layers (v11) +- Instead of returning list of results, we should return iterators. This + will support larger datasets in a more efficient manner. +- Implement better CRUD handling diff --git a/base_external_dbsource/readme/ROADMAP.rst b/base_external_dbsource/readme/ROADMAP.rst deleted file mode 100644 index 853d0579..00000000 --- a/base_external_dbsource/readme/ROADMAP.rst +++ /dev/null @@ -1,8 +0,0 @@ -* Find a way to remove or default the CA certs dir -* Add concept of multiple connection strings for one source (multiple nodes) -* Add a ConnectionEnvironment that allows for the reuse of connections -* Message box should be displayed instead of error in ``connection_test`` -* Remove old api compatibility layers (v11) -* Instead of returning list of results, we should return iterators. This will - support larger datasets in a more efficient manner. -* Implement better CRUD handling diff --git a/base_external_dbsource/readme/USAGE.md b/base_external_dbsource/readme/USAGE.md new file mode 100644 index 00000000..36baa572 --- /dev/null +++ b/base_external_dbsource/readme/USAGE.md @@ -0,0 +1,6 @@ +- Go to Settings \> Technical \> Database Structure \> Database Sources +- Click on Create to enter the following information: +- Data source name  +- Password +- Connector: Choose the database to which you want to connect +- Connection string: Specify how to connect to database diff --git a/base_external_dbsource/readme/USAGE.rst b/base_external_dbsource/readme/USAGE.rst deleted file mode 100644 index 4b219923..00000000 --- a/base_external_dbsource/readme/USAGE.rst +++ /dev/null @@ -1,7 +0,0 @@ -* Go to Settings > Technical > Database Structure > Database Sources -* Click on Create to enter the following information: - -* Data source name  -* Password -* Connector: Choose the database to which you want to connect -* Connection string: Specify how to connect to database diff --git a/base_external_dbsource/static/description/index.html b/base_external_dbsource/static/description/index.html index b2721a7d..79f5b7f3 100644 --- a/base_external_dbsource/static/description/index.html +++ b/base_external_dbsource/static/description/index.html @@ -1,4 +1,3 @@ - @@ -9,10 +8,11 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. +Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -275,7 +275,7 @@ pre.literal-block, pre.doctest-block, pre.math, pre.code { margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: grey; } /* line numbers */ +pre.code .ln { color: gray; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -301,7 +301,7 @@ span.option { span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -369,9 +369,9 @@ ul.auto-toc { !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:b6b6d53c12bad99b5a75536b07a9b3de684f59baadf1b10f4612f5f25640b26d !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: LGPL-3 OCA/server-backend Translate me on Weblate Try me on Runboat

-

This module allows you to define connections to foreign databases using ODBC, -Firebird, Oracle Client or SQLAlchemy.

+

Beta License: LGPL-3 OCA/server-backend Translate me on Weblate Try me on Runboat

+

This module allows you to define connections to foreign databases using +ODBC, Firebird, Oracle Client or SQLAlchemy.

Table of contents

    @@ -396,8 +396,8 @@ Firebird, Oracle Client or SQLAlchemy.

    Configuration

    To configure this module, you need to:

      -
    1. Database sources can be configured in Settings > Technical > -Database Structure > Data sources.
    2. +
    3. Database sources can be configured in Settings > Technical > Database +Structure > Data sources.
@@ -415,12 +415,14 @@ Database Structure > Data sources.

Known issues / Roadmap

  • Find a way to remove or default the CA certs dir
  • -
  • Add concept of multiple connection strings for one source (multiple nodes)
  • +
  • Add concept of multiple connection strings for one source (multiple +nodes)
  • Add a ConnectionEnvironment that allows for the reuse of connections
  • -
  • Message box should be displayed instead of error in connection_test
  • +
  • Message box should be displayed instead of error in +connection_test
  • Remove old api compatibility layers (v11)
  • -
  • Instead of returning list of results, we should return iterators. This will -support larger datasets in a more efficient manner.
  • +
  • Instead of returning list of results, we should return iterators. +This will support larger datasets in a more efficient manner.
  • Implement better CRUD handling
@@ -429,7 +431,7 @@ support larger datasets in a more efficient manner.

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -feedback.

+feedback.

Do not contact contributors directly about support or help with technical issues.

@@ -459,11 +461,13 @@ If you spotted it first, help us to smash it by providing a detailed and welcome

Maintainers

This module is maintained by the OCA.

-Odoo Community Association + +Odoo Community Association +

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 project on GitHub.

+

This module is part of the OCA/server-backend project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.