From f6f668a869b8684e747ba90819ed3f608066c9b2 Mon Sep 17 00:00:00 2001 From: Simone Orsi Date: Thu, 24 Sep 2026 18:23:33 +0200 Subject: [PATCH 1/2] [REF] edi_webservice_oca: split core and component Split edi_webservice_oca into: - edi_webservice_core_oca: the webservice_backend_id link on edi.backend, with no dependency on component/edi_component_oca. It also provides edi.webservice.send, a plain send_model_id handler - the official replacement for the deprecated component-based one. - edi_webservice_component_oca: the deprecated component-based edi.webservice.send integration, kept for backward compatibility. edi_webservice_oca becomes a thin umbrella depending on both, to preserve existing installations and modules depending on it. A post_load hook logs a deprecation warning pointing to the right module to depend on instead. Existing xmlids (views, access rules) are preserved on upgrade via a pre_init_hook rename, verified with a real before/after install. Demo data is not: demo databases getting a duplicate is not a concern. --- edi_webservice_component_oca/README.rst | 140 +++++ edi_webservice_component_oca/__init__.py | 2 + edi_webservice_component_oca/__manifest__.py | 18 + .../components/__init__.py | 0 .../components/send.py | 4 +- .../models/__init__.py | 0 .../models/edi_backend.py | 4 +- edi_webservice_component_oca/pyproject.toml | 3 + .../readme/CONFIGURE.md | 5 +- .../readme/CONTRIBUTORS.md | 2 + .../readme/DESCRIPTION.md | 14 + .../static/description/index.html | 469 +++++++++++++++++ .../tests/__init__.py | 0 .../tests/common.py | 2 +- .../tests/test_backend.py | 0 .../tests/test_send.py | 0 edi_webservice_core_oca/README.rst | 149 ++++++ edi_webservice_core_oca/__init__.py | 2 + edi_webservice_core_oca/__manifest__.py | 20 + .../demo/edi_backend.xml | 2 + edi_webservice_core_oca/hooks.py | 20 + edi_webservice_core_oca/models/__init__.py | 2 + edi_webservice_core_oca/models/edi_backend.py | 10 + .../models/edi_webservice_send.py | 51 ++ edi_webservice_core_oca/pyproject.toml | 3 + edi_webservice_core_oca/readme/CONFIGURE.md | 39 ++ .../readme/CONTRIBUTORS.md | 2 + edi_webservice_core_oca/readme/DESCRIPTION.md | 15 + .../security/ir.model.access.csv | 2 +- .../static/description/index.html | 477 ++++++++++++++++++ edi_webservice_core_oca/tests/__init__.py | 2 + edi_webservice_core_oca/tests/common.py | 26 + edi_webservice_core_oca/tests/test_backend.py | 19 + edi_webservice_core_oca/tests/test_send.py | 101 ++++ .../views/edi_backend.xml | 1 + edi_webservice_oca/README.rst | 62 +-- edi_webservice_oca/__init__.py | 3 +- edi_webservice_oca/__manifest__.py | 8 +- edi_webservice_oca/hooks.py | 24 + edi_webservice_oca/readme/DESCRIPTION.md | 12 +- .../static/description/index.html | 79 +-- 41 files changed, 1672 insertions(+), 122 deletions(-) create mode 100644 edi_webservice_component_oca/README.rst create mode 100644 edi_webservice_component_oca/__init__.py create mode 100644 edi_webservice_component_oca/__manifest__.py rename {edi_webservice_oca => edi_webservice_component_oca}/components/__init__.py (100%) rename {edi_webservice_oca => edi_webservice_component_oca}/components/send.py (94%) rename {edi_webservice_oca => edi_webservice_component_oca}/models/__init__.py (100%) rename {edi_webservice_oca => edi_webservice_component_oca}/models/edi_backend.py (93%) create mode 100644 edi_webservice_component_oca/pyproject.toml rename {edi_webservice_oca => edi_webservice_component_oca}/readme/CONFIGURE.md (92%) create mode 100644 edi_webservice_component_oca/readme/CONTRIBUTORS.md create mode 100644 edi_webservice_component_oca/readme/DESCRIPTION.md create mode 100644 edi_webservice_component_oca/static/description/index.html rename {edi_webservice_oca => edi_webservice_component_oca}/tests/__init__.py (100%) rename {edi_webservice_oca => edi_webservice_component_oca}/tests/common.py (91%) rename {edi_webservice_oca => edi_webservice_component_oca}/tests/test_backend.py (100%) rename {edi_webservice_oca => edi_webservice_component_oca}/tests/test_send.py (100%) create mode 100644 edi_webservice_core_oca/README.rst create mode 100644 edi_webservice_core_oca/__init__.py create mode 100644 edi_webservice_core_oca/__manifest__.py rename {edi_webservice_oca => edi_webservice_core_oca}/demo/edi_backend.xml (89%) create mode 100644 edi_webservice_core_oca/hooks.py create mode 100644 edi_webservice_core_oca/models/__init__.py create mode 100644 edi_webservice_core_oca/models/edi_backend.py create mode 100644 edi_webservice_core_oca/models/edi_webservice_send.py create mode 100644 edi_webservice_core_oca/pyproject.toml create mode 100644 edi_webservice_core_oca/readme/CONFIGURE.md create mode 100644 edi_webservice_core_oca/readme/CONTRIBUTORS.md create mode 100644 edi_webservice_core_oca/readme/DESCRIPTION.md rename {edi_webservice_oca => edi_webservice_core_oca}/security/ir.model.access.csv (63%) create mode 100644 edi_webservice_core_oca/static/description/index.html create mode 100644 edi_webservice_core_oca/tests/__init__.py create mode 100644 edi_webservice_core_oca/tests/common.py create mode 100644 edi_webservice_core_oca/tests/test_backend.py create mode 100644 edi_webservice_core_oca/tests/test_send.py rename {edi_webservice_oca => edi_webservice_core_oca}/views/edi_backend.xml (95%) create mode 100644 edi_webservice_oca/hooks.py diff --git a/edi_webservice_component_oca/README.rst b/edi_webservice_component_oca/README.rst new file mode 100644 index 000000000..fa7f3667a --- /dev/null +++ b/edi_webservice_component_oca/README.rst @@ -0,0 +1,140 @@ +======================== +EDI WebService Component +======================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:3bab37ebd62518d7fd581efa6c8d7c9b3c3f493f3514089083bb4cf8024e1a68 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fedi--framework-lightgray.png?logo=github + :target: https://github.com/OCA/edi-framework/tree/18.0/edi_webservice_component_oca + :alt: OCA/edi-framework +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/edi-framework-18-0/edi-framework-18-0-edi_webservice_component_oca + :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/edi-framework&target_branch=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +**Deprecated.** Provides the ``component``-based ``edi.webservice.send`` +integration for EDI Exchange records (configured via an exchange type's +advanced settings, under ``components: send: usage: webservice.send``), +kept only for backward compatibility with existing setups - including +any custom ``_inherit`` of this component. + +It used to be part of ``edi_webservice_oca`` itself; it now lives here +so that installing ``edi_webservice_oca`` no longer requires +``component`` unless you actually need this integration style. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +Go to "EDI -> Config -> Backends" and edit or create one. Find the tab +"Webservice" and add a webservice. On the webservice record you can +specify all the general parameters to connect to the service (see +webservice README for more details). + +If you want to take full control on if/how the webservice is used you +can do it via exchange type's advanced settings. + +Hence, assuming your webservice has a URL configured as +\`\ https://my.endpoint/%7Bpath%7D\ \`: + +:: + + components: + send: + usage: webservice.send # or any custom component usage inheriting from this + work_ctx: + webservice: + method: post # mandatory + url_params: + path: endpoint1/foo + +For each call related to this type, you'll get a POST request against +https://my.endpoint/endpoint/foo. + +``url_params`` can contain all the keys need for URL interpolation. + +In addition, you can user ``url`` to override the full url used for the +call per exchange type. + +If you want to send data as bytes you can use the option send_as_bytes +like: + +:: + + [...] + webservice: + send_as_bytes: true + [...] + +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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Dixmit +* Camptocamp + +Contributors +------------ + +- Enric Tobella +- Simone Orsi + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +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. + +.. |maintainer-etobella| image:: https://github.com/etobella.png?size=40px + :target: https://github.com/etobella + :alt: etobella +.. |maintainer-simahawk| image:: https://github.com/simahawk.png?size=40px + :target: https://github.com/simahawk + :alt: simahawk + +Current `maintainers `__: + +|maintainer-etobella| |maintainer-simahawk| + +This module is part of the `OCA/edi-framework `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/edi_webservice_component_oca/__init__.py b/edi_webservice_component_oca/__init__.py new file mode 100644 index 000000000..f24d3e242 --- /dev/null +++ b/edi_webservice_component_oca/__init__.py @@ -0,0 +1,2 @@ +from . import components +from . import models diff --git a/edi_webservice_component_oca/__manifest__.py b/edi_webservice_component_oca/__manifest__.py new file mode 100644 index 000000000..13bfc1dfc --- /dev/null +++ b/edi_webservice_component_oca/__manifest__.py @@ -0,0 +1,18 @@ +# Copyright 2020 Dixmit +# Copyright 2022 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "EDI WebService Component", + "summary": """ + Component-based webservice send for EDI Exchange records - + legacy integration style, superseded by edi_webservice_core_oca's + handler""", + "version": "18.0.1.0.0", + "license": "AGPL-3", + "development_status": "Beta", + "author": "Dixmit, Camptocamp, Odoo Community Association (OCA)", + "maintainers": ["etobella", "simahawk"], + "website": "https://github.com/OCA/edi-framework", + "depends": ["edi_webservice_core_oca", "edi_component_oca"], +} diff --git a/edi_webservice_oca/components/__init__.py b/edi_webservice_component_oca/components/__init__.py similarity index 100% rename from edi_webservice_oca/components/__init__.py rename to edi_webservice_component_oca/components/__init__.py diff --git a/edi_webservice_oca/components/send.py b/edi_webservice_component_oca/components/send.py similarity index 94% rename from edi_webservice_oca/components/send.py rename to edi_webservice_component_oca/components/send.py index 43d7f12fd..f90b0b01f 100644 --- a/edi_webservice_oca/components/send.py +++ b/edi_webservice_component_oca/components/send.py @@ -4,7 +4,7 @@ from requests import Response -from odoo import _, exceptions +from odoo import exceptions from odoo.addons.component.core import Component @@ -42,7 +42,7 @@ def _get_call_params(self): method = self.ws_settings["method"].lower() except KeyError as err: raise exceptions.UserError( - _("`method` is required in `webservice` type settings.") + self.env._("`method` is required in `webservice` type settings.") ) from err pargs = self.ws_settings.get("pargs", []) kwargs = self.ws_settings.get("kwargs", {}) diff --git a/edi_webservice_oca/models/__init__.py b/edi_webservice_component_oca/models/__init__.py similarity index 100% rename from edi_webservice_oca/models/__init__.py rename to edi_webservice_component_oca/models/__init__.py diff --git a/edi_webservice_oca/models/edi_backend.py b/edi_webservice_component_oca/models/edi_backend.py similarity index 93% rename from edi_webservice_oca/models/edi_backend.py rename to edi_webservice_component_oca/models/edi_backend.py index c232d6e2b..a863f4c08 100644 --- a/edi_webservice_oca/models/edi_backend.py +++ b/edi_webservice_component_oca/models/edi_backend.py @@ -1,13 +1,13 @@ # Copyright 2020 Dixmit +# Copyright 2025 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import fields, models +from odoo import models class EdiBackend(models.Model): _inherit = "edi.backend" - webservice_backend_id = fields.Many2one("webservice.backend") _webservice_actions = ("send", "receive") def _get_component_usage_candidates(self, exchange_record, key): diff --git a/edi_webservice_component_oca/pyproject.toml b/edi_webservice_component_oca/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/edi_webservice_component_oca/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/edi_webservice_oca/readme/CONFIGURE.md b/edi_webservice_component_oca/readme/CONFIGURE.md similarity index 92% rename from edi_webservice_oca/readme/CONFIGURE.md rename to edi_webservice_component_oca/readme/CONFIGURE.md index bb47d4dae..88afc5ef7 100644 --- a/edi_webservice_oca/readme/CONFIGURE.md +++ b/edi_webservice_component_oca/readme/CONFIGURE.md @@ -15,8 +15,9 @@ Hence, assuming your webservice has a URL configured as work_ctx: webservice: method: post # mandatory - url_params: - path: endpoint1/foo + kwargs: + url_params: + path: endpoint1/foo For each call related to this type, you'll get a POST request against https://my.endpoint/endpoint/foo. diff --git a/edi_webservice_component_oca/readme/CONTRIBUTORS.md b/edi_webservice_component_oca/readme/CONTRIBUTORS.md new file mode 100644 index 000000000..86f1c6189 --- /dev/null +++ b/edi_webservice_component_oca/readme/CONTRIBUTORS.md @@ -0,0 +1,2 @@ +- Enric Tobella \<\> +- Simone Orsi \<\> diff --git a/edi_webservice_component_oca/readme/DESCRIPTION.md b/edi_webservice_component_oca/readme/DESCRIPTION.md new file mode 100644 index 000000000..473f5f30b --- /dev/null +++ b/edi_webservice_component_oca/readme/DESCRIPTION.md @@ -0,0 +1,14 @@ +Provides the `component`-based `edi.webservice.send` integration for EDI +Exchange records (configured via an exchange type's advanced settings, +under `components: send: usage: webservice.send`), for setups that still +rely on it - including any custom `_inherit` of this component. + +It used to be part of `edi_webservice_oca` itself; it now lives here so +that installing `edi_webservice_oca` no longer requires `component` +unless you actually need this integration style. + +This module itself is not deprecated: it's the supported way to get +`component`-based integration on demand. The integration *style* is the +legacy one, though - new exchange types should use the model-based +handler in `edi_webservice_core_oca` instead (selected via +`send_model_id`). diff --git a/edi_webservice_component_oca/static/description/index.html b/edi_webservice_component_oca/static/description/index.html new file mode 100644 index 000000000..0457a7d85 --- /dev/null +++ b/edi_webservice_component_oca/static/description/index.html @@ -0,0 +1,469 @@ + + + + + +EDI WebService Component + + + +
+

EDI WebService Component

+ + +

Beta License: AGPL-3 OCA/edi-framework Translate me on Weblate Try me on Runboat

+

Deprecated. Provides the component-based edi.webservice.send +integration for EDI Exchange records (configured via an exchange type’s +advanced settings, under components: send: usage: webservice.send), +kept only for backward compatibility with existing setups - including +any custom _inherit of this component.

+

It used to be part of edi_webservice_oca itself; it now lives here +so that installing edi_webservice_oca no longer requires +component unless you actually need this integration style.

+

Table of contents

+ +
+

Configuration

+

Go to “EDI -> Config -> Backends” and edit or create one. Find the tab +“Webservice” and add a webservice. On the webservice record you can +specify all the general parameters to connect to the service (see +webservice README for more details).

+

If you want to take full control on if/how the webservice is used you +can do it via exchange type’s advanced settings.

+

Hence, assuming your webservice has a URL configured as +`https://my.endpoint/%7Bpath%7D`:

+
+components:
+  send:
+    usage: webservice.send  # or any custom component usage inheriting from this
+    work_ctx:
+      webservice:
+        method: post  # mandatory
+        url_params:
+          path: endpoint1/foo
+
+

For each call related to this type, you’ll get a POST request against +https://my.endpoint/endpoint/foo.

+

url_params can contain all the keys need for URL interpolation.

+

In addition, you can user url to override the full url used for the +call per exchange type.

+

If you want to send data as bytes you can use the option send_as_bytes +like:

+
+[...]
+      webservice:
+        send_as_bytes: true
+[...]
+
+
+
+

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.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Dixmit
  • +
  • Camptocamp
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +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.

+

Current maintainers:

+

etobella simahawk

+

This module is part of the OCA/edi-framework project on GitHub.

+

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

+
+
+
+ + diff --git a/edi_webservice_oca/tests/__init__.py b/edi_webservice_component_oca/tests/__init__.py similarity index 100% rename from edi_webservice_oca/tests/__init__.py rename to edi_webservice_component_oca/tests/__init__.py diff --git a/edi_webservice_oca/tests/common.py b/edi_webservice_component_oca/tests/common.py similarity index 91% rename from edi_webservice_oca/tests/common.py rename to edi_webservice_component_oca/tests/common.py index 3bd9c1f9d..6e1a57521 100644 --- a/edi_webservice_oca/tests/common.py +++ b/edi_webservice_component_oca/tests/common.py @@ -9,7 +9,7 @@ class TestEDIWebserviceBase(EDIBackendCommonComponentTestCase): @classmethod def _get_backend(cls): - return cls.env.ref("edi_webservice_oca.demo_edi_backend") + return cls.env.ref("edi_webservice_core_oca.demo_edi_backend") @classmethod def _setup_records(cls): diff --git a/edi_webservice_oca/tests/test_backend.py b/edi_webservice_component_oca/tests/test_backend.py similarity index 100% rename from edi_webservice_oca/tests/test_backend.py rename to edi_webservice_component_oca/tests/test_backend.py diff --git a/edi_webservice_oca/tests/test_send.py b/edi_webservice_component_oca/tests/test_send.py similarity index 100% rename from edi_webservice_oca/tests/test_send.py rename to edi_webservice_component_oca/tests/test_send.py diff --git a/edi_webservice_core_oca/README.rst b/edi_webservice_core_oca/README.rst new file mode 100644 index 000000000..2d08edb9d --- /dev/null +++ b/edi_webservice_core_oca/README.rst @@ -0,0 +1,149 @@ +=================== +EDI WebService Core +=================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:b7277834c1c3e586d3bbc705d8c8a46f20c79a736014f0f25f351b78611bd629 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fedi--framework-lightgray.png?logo=github + :target: https://github.com/OCA/edi-framework/tree/18.0/edi_webservice_core_oca + :alt: OCA/edi-framework +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/edi-framework-18-0/edi-framework-18-0-edi_webservice_core_oca + :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/edi-framework&target_branch=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Attach a ``webservice.backend`` to an EDI backend, and send EDI exchange +files through it. + +This module provides: + +- The ``webservice_backend_id`` field on ``edi.backend``. +- ``edi.webservice.send``, a plain ``send_model_id`` handler that sends + the exchange file through the backend's webservice - no ``component`` + dependency. + +``edi_webservice_component_oca`` provides the deprecated, +``component``-based equivalent (``components/send.py``), kept separate +so installing it - and ``component`` with it - is opt-in. +``edi_webservice_oca`` is now just an umbrella depending on both, kept +to preserve existing installations. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +Go to "EDI -> Config -> Backends" and edit or create one. Find the tab +"Webservice" and add a webservice. On the webservice record you can +specify all the general parameters to connect to the service (see +``webservice_core`` README for more details). + +On the exchange type you want to send through a webservice, go to the +"Execution handlers" tab and set "Sender" to "EDI WebService Send +Handler". + +By default the call uses the backend's own configuration (URL, auth, +...). If you want to take full control on if/how the webservice is used +you can do it via the exchange type's advanced settings. + +Hence, assuming your webservice has a URL configured as +\`\ https://my.endpoint/%7Bpath%7D\ \`: + +:: + + execution_model: + send: + webservice: + method: post # mandatory + url_params: + path: endpoint1/foo + +For each call related to this type, you'll get a POST request against +https://my.endpoint/endpoint/foo. + +``url_params`` can contain all the keys needed for URL interpolation. + +In addition, you can use ``url`` to override the full url used for the +call per exchange type. + +If you want to send data as bytes you can use the option send_as_bytes +like: + +:: + + [...] + webservice: + send_as_bytes: true + [...] + +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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Dixmit +* Camptocamp + +Contributors +------------ + +- Simone Orsi +- Enric Tobella + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +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. + +.. |maintainer-etobella| image:: https://github.com/etobella.png?size=40px + :target: https://github.com/etobella + :alt: etobella +.. |maintainer-simahawk| image:: https://github.com/simahawk.png?size=40px + :target: https://github.com/simahawk + :alt: simahawk + +Current `maintainers `__: + +|maintainer-etobella| |maintainer-simahawk| + +This module is part of the `OCA/edi-framework `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/edi_webservice_core_oca/__init__.py b/edi_webservice_core_oca/__init__.py new file mode 100644 index 000000000..6d58305f5 --- /dev/null +++ b/edi_webservice_core_oca/__init__.py @@ -0,0 +1,2 @@ +from . import models +from .hooks import pre_init_hook diff --git a/edi_webservice_core_oca/__manifest__.py b/edi_webservice_core_oca/__manifest__.py new file mode 100644 index 000000000..1bfdd34cd --- /dev/null +++ b/edi_webservice_core_oca/__manifest__.py @@ -0,0 +1,20 @@ +# Copyright 2020 Dixmit +# Copyright 2022 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "EDI WebService Core", + "summary": """ + Webservice backend and send handler for EDI: no component + dependency""", + "version": "18.0.1.1.0", + "license": "AGPL-3", + "development_status": "Beta", + "author": "Dixmit, Camptocamp, Odoo Community Association (OCA)", + "maintainers": ["etobella", "simahawk"], + "website": "https://github.com/OCA/edi-framework", + "depends": ["edi_core_oca", "webservice_core"], + "data": ["views/edi_backend.xml", "security/ir.model.access.csv"], + "demo": ["demo/edi_backend.xml"], + "pre_init_hook": "pre_init_hook", +} diff --git a/edi_webservice_oca/demo/edi_backend.xml b/edi_webservice_core_oca/demo/edi_backend.xml similarity index 89% rename from edi_webservice_oca/demo/edi_backend.xml rename to edi_webservice_core_oca/demo/edi_backend.xml index 5c0346242..f1e973b1d 100644 --- a/edi_webservice_oca/demo/edi_backend.xml +++ b/edi_webservice_core_oca/demo/edi_backend.xml @@ -1,4 +1,6 @@ + Demo backend diff --git a/edi_webservice_core_oca/hooks.py b/edi_webservice_core_oca/hooks.py new file mode 100644 index 000000000..3dfda8404 --- /dev/null +++ b/edi_webservice_core_oca/hooks.py @@ -0,0 +1,20 @@ +# Copyright 2026 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from openupgradelib import openupgrade + +# xids to pass to the new module +MOVED_XMLIDS = [ + "access_webservice_backend_edi_manager", + "edi_backend_view_form", +] + + +def pre_init_hook(env): + """Reuse `edi_webservice_oca`'s pre-split records instead of duplicating them.""" + openupgrade.rename_xmlids( + env.cr, + [ + (f"edi_webservice_oca.{xmlid}", f"edi_webservice_core_oca.{xmlid}") + for xmlid in MOVED_XMLIDS + ], + ) diff --git a/edi_webservice_core_oca/models/__init__.py b/edi_webservice_core_oca/models/__init__.py new file mode 100644 index 000000000..f26266f4d --- /dev/null +++ b/edi_webservice_core_oca/models/__init__.py @@ -0,0 +1,2 @@ +from . import edi_backend +from . import edi_webservice_send diff --git a/edi_webservice_core_oca/models/edi_backend.py b/edi_webservice_core_oca/models/edi_backend.py new file mode 100644 index 000000000..2bed19154 --- /dev/null +++ b/edi_webservice_core_oca/models/edi_backend.py @@ -0,0 +1,10 @@ +# Copyright 2020 Dixmit +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class EdiBackend(models.Model): + _inherit = "edi.backend" + + webservice_backend_id = fields.Many2one("webservice.backend") diff --git a/edi_webservice_core_oca/models/edi_webservice_send.py b/edi_webservice_core_oca/models/edi_webservice_send.py new file mode 100644 index 000000000..69be8600f --- /dev/null +++ b/edi_webservice_core_oca/models/edi_webservice_send.py @@ -0,0 +1,51 @@ +# Copyright 2022 Camptocamp SA +# @author: Simone Orsi +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from requests import Response + +from odoo import exceptions, models + + +class EDIWebserviceSend(models.AbstractModel): + """Generic handler for sending EDI exchange files through a webservice. + + Configuration is expected to come from the exchange type's advanced + settings, under ``execution_model.send.webservice``. + """ + + _name = "edi.webservice.send" + _inherit = "edi.oca.handler.send" + _description = "EDI WebService Send Handler" + + def send(self, exchange_record): + ws_settings = self._get_ws_settings(exchange_record) + method, pargs, kwargs = self._get_call_params(exchange_record, ws_settings) + response = exchange_record.backend_id.webservice_backend_id.call( + method, *pargs, **kwargs + ) + if not isinstance(response, Response): + # backward compat for obsolete `content_only` param + return response + return response.content + + def _get_ws_settings(self, exchange_record): + settings = exchange_record.type_id.get_settings() + return settings.get("execution_model", {}).get("send", {}).get("webservice", {}) + + def _get_call_params(self, exchange_record, ws_settings): + try: + method = ws_settings["method"].lower() + except KeyError as err: + raise exceptions.UserError( + self.env._("`method` is required in `webservice` type settings.") + ) from err + pargs = ws_settings.get("pargs", []) + kwargs = ws_settings.get("kwargs", {}) + kwargs["data"] = self._get_data(exchange_record, ws_settings) + return method, pargs, kwargs + + def _get_data(self, exchange_record, ws_settings): + # By sending as bytes `requests` won't try to guess and/or alter the encoding. + as_bytes = ws_settings.get("send_as_bytes") + return exchange_record._get_file_content(as_bytes=as_bytes) diff --git a/edi_webservice_core_oca/pyproject.toml b/edi_webservice_core_oca/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/edi_webservice_core_oca/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/edi_webservice_core_oca/readme/CONFIGURE.md b/edi_webservice_core_oca/readme/CONFIGURE.md new file mode 100644 index 000000000..7cc549a14 --- /dev/null +++ b/edi_webservice_core_oca/readme/CONFIGURE.md @@ -0,0 +1,39 @@ +Go to "EDI -\> Config -\> Backends" and edit or create one. Find the tab +"Webservice" and add a webservice. On the webservice record you can +specify all the general parameters to connect to the service (see +`webservice_core` README for more details). + +On the exchange type you want to send through a webservice, go to the +"Execution handlers" tab and set "Sender" to "EDI WebService Send +Handler". + +By default the call uses the backend's own configuration (URL, auth, +...). If you want to take full control on if/how the webservice is used +you can do it via the exchange type's advanced settings. + +Hence, assuming your webservice has a URL configured as +\`\`: + + execution_model: + send: + webservice: + method: post # mandatory + kwargs: + url_params: + path: endpoint1/foo + +For each call related to this type, you'll get a POST request against +https://my.endpoint/endpoint/foo. + +`url_params` can contain all the keys needed for URL interpolation. + +In addition, you can use `url` to override the full url used for the +call per exchange type. + +If you want to send data as bytes you can use the option send_as_bytes +like: + + [...] + webservice: + send_as_bytes: true + [...] diff --git a/edi_webservice_core_oca/readme/CONTRIBUTORS.md b/edi_webservice_core_oca/readme/CONTRIBUTORS.md new file mode 100644 index 000000000..83ba62492 --- /dev/null +++ b/edi_webservice_core_oca/readme/CONTRIBUTORS.md @@ -0,0 +1,2 @@ +- Simone Orsi \<\> +- Enric Tobella \<\> diff --git a/edi_webservice_core_oca/readme/DESCRIPTION.md b/edi_webservice_core_oca/readme/DESCRIPTION.md new file mode 100644 index 000000000..bcaf3ba51 --- /dev/null +++ b/edi_webservice_core_oca/readme/DESCRIPTION.md @@ -0,0 +1,15 @@ +Attach a `webservice.backend` to an EDI backend, and send EDI exchange +files through it. + +This module provides: + +- The `webservice_backend_id` field on `edi.backend`. +- `edi.webservice.send`, a plain `send_model_id` handler that sends the + exchange file through the backend's webservice - no `component` + dependency. + +`edi_webservice_component_oca` provides the `component`-based equivalent +(`components/send.py`) - a legacy integration style, kept in its own +module so installing it (and `component` with it) is opt-in. +`edi_webservice_oca` is now just a deprecated umbrella depending on both, +kept to preserve existing installations. diff --git a/edi_webservice_oca/security/ir.model.access.csv b/edi_webservice_core_oca/security/ir.model.access.csv similarity index 63% rename from edi_webservice_oca/security/ir.model.access.csv rename to edi_webservice_core_oca/security/ir.model.access.csv index 03c66bda8..f146f6d9a 100644 --- a/edi_webservice_oca/security/ir.model.access.csv +++ b/edi_webservice_core_oca/security/ir.model.access.csv @@ -1,2 +1,2 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_webservice_backend_edi_manager,webservice_backend edi manager,webservice.model_webservice_backend,base_edi.group_edi_manager,1,1,1,1 +access_webservice_backend_edi_manager,webservice_backend edi manager,webservice_core.model_webservice_backend,base_edi.group_edi_manager,1,1,1,1 diff --git a/edi_webservice_core_oca/static/description/index.html b/edi_webservice_core_oca/static/description/index.html new file mode 100644 index 000000000..239304967 --- /dev/null +++ b/edi_webservice_core_oca/static/description/index.html @@ -0,0 +1,477 @@ + + + + + +EDI WebService Core + + + +
+

EDI WebService Core

+ + +

Beta License: AGPL-3 OCA/edi-framework Translate me on Weblate Try me on Runboat

+

Attach a webservice.backend to an EDI backend, and send EDI exchange +files through it.

+

This module provides:

+
    +
  • The webservice_backend_id field on edi.backend.
  • +
  • edi.webservice.send, a plain send_model_id handler that sends +the exchange file through the backend’s webservice - no component +dependency.
  • +
+

edi_webservice_component_oca provides the deprecated, +component-based equivalent (components/send.py), kept separate +so installing it - and component with it - is opt-in. +edi_webservice_oca is now just an umbrella depending on both, kept +to preserve existing installations.

+

Table of contents

+ +
+

Configuration

+

Go to “EDI -> Config -> Backends” and edit or create one. Find the tab +“Webservice” and add a webservice. On the webservice record you can +specify all the general parameters to connect to the service (see +webservice_core README for more details).

+

On the exchange type you want to send through a webservice, go to the +“Execution handlers” tab and set “Sender” to “EDI WebService Send +Handler”.

+

By default the call uses the backend’s own configuration (URL, auth, +…). If you want to take full control on if/how the webservice is used +you can do it via the exchange type’s advanced settings.

+

Hence, assuming your webservice has a URL configured as +`https://my.endpoint/%7Bpath%7D`:

+
+execution_model:
+  send:
+    webservice:
+      method: post  # mandatory
+      url_params:
+        path: endpoint1/foo
+
+

For each call related to this type, you’ll get a POST request against +https://my.endpoint/endpoint/foo.

+

url_params can contain all the keys needed for URL interpolation.

+

In addition, you can use url to override the full url used for the +call per exchange type.

+

If you want to send data as bytes you can use the option send_as_bytes +like:

+
+[...]
+      webservice:
+        send_as_bytes: true
+[...]
+
+
+
+

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.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Dixmit
  • +
  • Camptocamp
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +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.

+

Current maintainers:

+

etobella simahawk

+

This module is part of the OCA/edi-framework project on GitHub.

+

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

+
+
+
+ + diff --git a/edi_webservice_core_oca/tests/__init__.py b/edi_webservice_core_oca/tests/__init__.py new file mode 100644 index 000000000..825af6718 --- /dev/null +++ b/edi_webservice_core_oca/tests/__init__.py @@ -0,0 +1,2 @@ +from . import test_backend +from . import test_send diff --git a/edi_webservice_core_oca/tests/common.py b/edi_webservice_core_oca/tests/common.py new file mode 100644 index 000000000..6dd42527e --- /dev/null +++ b/edi_webservice_core_oca/tests/common.py @@ -0,0 +1,26 @@ +# Copyright 2026 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +import base64 + +from odoo.addons.edi_core_oca.tests.common import EDIBackendCommonTestCase + + +class TestEDIWebserviceCoreBase(EDIBackendCommonTestCase): + @classmethod + def _get_backend(cls): + return cls.env.ref("edi_webservice_core_oca.demo_edi_backend") + + @classmethod + def _setup_records(cls): + result = super()._setup_records() + cls.filedata = base64.b64encode(b"This is a simple file") + vals = { + "model": cls.partner._name, + "res_id": cls.partner.id, + "exchange_file": cls.filedata, + } + cls.record = cls.backend.create_record("test_csv_output", vals) + cls.record.type_id.send_model_id = cls.env.ref( + "edi_webservice_core_oca.model_edi_webservice_send" + ) + return result diff --git a/edi_webservice_core_oca/tests/test_backend.py b/edi_webservice_core_oca/tests/test_backend.py new file mode 100644 index 000000000..1b888e496 --- /dev/null +++ b/edi_webservice_core_oca/tests/test_backend.py @@ -0,0 +1,19 @@ +# Copyright 2026 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo.addons.edi_core_oca.tests.common import EDIBackendCommonTestCase + + +class TestEdiWebserviceCore(EDIBackendCommonTestCase): + def test_webservice_backend_id(self): + webservice = self.env["webservice.backend"].create( + { + "name": "WebService", + "protocol": "http", + "url": "https://localhost.demo.odoo/", + "tech_name": "demo_ws_core", + "auth_type": "none", + } + ) + self.backend.webservice_backend_id = webservice + self.assertEqual(self.backend.webservice_backend_id, webservice) diff --git a/edi_webservice_core_oca/tests/test_send.py b/edi_webservice_core_oca/tests/test_send.py new file mode 100644 index 000000000..b6bc78ecb --- /dev/null +++ b/edi_webservice_core_oca/tests/test_send.py @@ -0,0 +1,101 @@ +# Copyright 2026 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from urllib.parse import urlparse + +import responses +from requests import PreparedRequest, Session + +from odoo import exceptions + +from .common import TestEDIWebserviceCoreBase + + +class TestSend(TestEDIWebserviceCoreBase): + @classmethod + def setUpClass(cls): + cls._super_send = Session.send + super().setUpClass() + + @classmethod + def _setup_records(cls): + result = super()._setup_records() + cls.ws_backend = cls.backend.webservice_backend_id + cls.settings = """ + execution_model: + send: + webservice: + method: post + kwargs: + url_params: + endpoint: push/here + """ + cls.record.type_id.set_settings(cls.settings) + return result + + @classmethod + def _request_handler(cls, s: Session, r: PreparedRequest, /, **kw): + # Allow request to test custom URL + if urlparse(r.url).netloc == "foo.test": + return cls._super_send(s, r) + return super()._request_handler(s, r, **kw) + + def _get_handler(self): + return self.env["edi.webservice.send"] + + def test_call_params(self): + handler = self._get_handler() + ws_settings = handler._get_ws_settings(self.record) + method, pargs, kwargs = handler._get_call_params(self.record, ws_settings) + self.assertEqual(method, "post") + self.assertEqual(pargs, []) + self.assertEqual(kwargs["data"], "This is a simple file") + self.assertEqual(kwargs["url_params"], {"endpoint": "push/here"}) + + def test_no_method(self): + handler = self._get_handler() + msg = "`method` is required in `webservice` type settings" + with self.assertRaisesRegex(exceptions.UserError, msg): + handler._get_call_params(self.record, {}) + + @responses.activate + def test_send(self): + url = "https://foo.test/push/here" + responses.add(responses.POST, url, body="{}") + result = self._get_handler().send(self.record) + self.assertEqual(result, b"{}") + self.assertEqual( + responses.calls[0].request.headers["Content-Type"], "application/xml" + ) + self.assertEqual(responses.calls[0].request.body, "This is a simple file") + + def test_send_as_bytes(self): + settings = """ + execution_model: + send: + webservice: + method: post + send_as_bytes: true + kwargs: + url_params: + endpoint: push/here + """ + self.record.type_id.set_settings(settings) + handler = self._get_handler() + ws_settings = handler._get_ws_settings(self.record) + method, pargs, kwargs = handler._get_call_params(self.record, ws_settings) + self.assertEqual(kwargs["data"], b"This is a simple file") + + @responses.activate + def test_exchange_send_dispatch(self): + # `send_model_id` on the exchange type is enough for the regular + # EDI framework dispatch (`backend.exchange_send`) to reach our + # handler - not just direct calls to it. + self.record.type_id.send_model_id = self.env.ref( + "edi_webservice_core_oca.model_edi_webservice_send" + ) + self.record.edi_exchange_state = "output_pending" + url = "https://foo.test/push/here" + responses.add(responses.POST, url, body="{}") + self.backend.exchange_send(self.record) + self.assertEqual(len(responses.calls), 1) + self.assertEqual(responses.calls[0].request.body, "This is a simple file") diff --git a/edi_webservice_oca/views/edi_backend.xml b/edi_webservice_core_oca/views/edi_backend.xml similarity index 95% rename from edi_webservice_oca/views/edi_backend.xml rename to edi_webservice_core_oca/views/edi_backend.xml index b2a71d774..fa33eeb39 100644 --- a/edi_webservice_oca/views/edi_backend.xml +++ b/edi_webservice_core_oca/views/edi_backend.xml @@ -1,5 +1,6 @@ diff --git a/edi_webservice_oca/README.rst b/edi_webservice_oca/README.rst index bffbe39e5..8ec06bda3 100644 --- a/edi_webservice_oca/README.rst +++ b/edi_webservice_oca/README.rst @@ -1,7 +1,3 @@ -.. image:: https://odoo-community.org/readme-banner-image - :target: https://odoo-community.org/get-involved?utm_source=readme - :alt: Odoo Community Association - ============== EDI WebService ============== @@ -17,7 +13,7 @@ EDI WebService .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png :target: https://odoo-community.org/page/development-status :alt: Beta -.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fedi--framework-lightgray.png?logo=github @@ -32,57 +28,23 @@ EDI WebService |badge1| |badge2| |badge3| |badge4| |badge5| -Plug webservice module within EDI framework. Allows to configure attach -webservices on an EDI backend and/or on an exchange type. +**Deprecated as a direct dependency.** This module is now just an +umbrella kept to preserve existing installations: it depends on both +``edi_webservice_core_oca`` (the ``webservice.backend`` link on +``edi.backend``, no ``component`` dependency) and +``edi_webservice_component_oca`` (the deprecated ``component``-based +send integration), both of which used to be part of this module. A +warning is logged on startup as a reminder. + +New code should depend on ``edi_webservice_core_oca`` directly, and +additionally on ``edi_webservice_component_oca`` only if it actually +uses the ``component``-based ``edi.webservice.send`` integration. **Table of contents** .. contents:: :local: -Configuration -============= - -Go to "EDI -> Config -> Backends" and edit or create one. Find the tab -"Webservice" and add a webservice. On the webservice record you can -specify all the general parameters to connect to the service (see -webservice README for more details). - -If you want to take full control on if/how the webservice is used you -can do it via exchange type's advanced settings. - -Hence, assuming your webservice has a URL configured as -\`\ https://my.endpoint/%7Bpath%7D\ \`: - -:: - - components: - send: - usage: webservice.send # or any custom component usage inheriting from this - work_ctx: - webservice: - method: post # mandatory - url_params: - path: endpoint1/foo - -For each call related to this type, you'll get a POST request against -https://my.endpoint/endpoint/foo. - -``url_params`` can contain all the keys need for URL interpolation. - -In addition, you can user ``url`` to override the full url used for the -call per exchange type. - -If you want to send data as bytes you can use the option send_as_bytes -like: - -:: - - [...] - webservice: - send_as_bytes: true - [...] - Bug Tracker =========== diff --git a/edi_webservice_oca/__init__.py b/edi_webservice_oca/__init__.py index f24d3e242..99ac2b54f 100644 --- a/edi_webservice_oca/__init__.py +++ b/edi_webservice_oca/__init__.py @@ -1,2 +1 @@ -from . import components -from . import models +from .hooks import post_load_hook diff --git a/edi_webservice_oca/__manifest__.py b/edi_webservice_oca/__manifest__.py index bfc22f43e..4d2e08941 100644 --- a/edi_webservice_oca/__manifest__.py +++ b/edi_webservice_oca/__manifest__.py @@ -1,17 +1,17 @@ # Copyright 2020 Dixmit +# Copyright 2022 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { "name": "EDI WebService", "summary": """ Defines webservice integration from EDI Exchange records""", - "version": "18.0.1.1.0", + "version": "18.0.2.0.0", "license": "AGPL-3", "development_status": "Beta", "author": "Dixmit, Camptocamp, Odoo Community Association (OCA)", "maintainers": ["etobella", "simahawk"], "website": "https://github.com/OCA/edi-framework", - "depends": ["edi_component_oca", "webservice"], - "data": ["views/edi_backend.xml", "security/ir.model.access.csv"], - "demo": ["demo/edi_backend.xml"], + "depends": ["edi_webservice_core_oca", "edi_webservice_component_oca"], + "post_load": "post_load_hook", } diff --git a/edi_webservice_oca/hooks.py b/edi_webservice_oca/hooks.py new file mode 100644 index 000000000..362d2864c --- /dev/null +++ b/edi_webservice_oca/hooks.py @@ -0,0 +1,24 @@ +# Copyright 2026 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +import logging + +_logger = logging.getLogger(__name__) + + +def post_load_hook(): + """Point installs of this now-empty umbrella to the module they need. + + `edi_webservice_oca` used to hold both the `webservice_backend_id` + field and the `component`-based send integration; it now only depends + on both split-out modules to preserve existing installations. + """ + _logger.info( + "DEPRECATED - 'edi_webservice_oca' is now just an umbrella kept for backward " + "compatibility: it depends on both 'edi_webservice_core_oca' " + "(the 'webservice.backend' link on 'edi.backend', no 'component' " + "dependency) and 'edi_webservice_component_oca' (the deprecated " + "'component'-based send integration). New code should depend on " + "'edi_webservice_core_oca' directly, and additionally on " + "'edi_webservice_component_oca' only if it actually uses the " + "'component'-based 'edi.webservice.send' integration." + ) diff --git a/edi_webservice_oca/readme/DESCRIPTION.md b/edi_webservice_oca/readme/DESCRIPTION.md index f5419e349..a7539ea31 100644 --- a/edi_webservice_oca/readme/DESCRIPTION.md +++ b/edi_webservice_oca/readme/DESCRIPTION.md @@ -1,2 +1,10 @@ -Plug webservice module within EDI framework. Allows to configure attach -webservices on an EDI backend and/or on an exchange type. +**Deprecated as a direct dependency.** This module is now just an umbrella +kept to preserve existing installations: it depends on both +`edi_webservice_core_oca` (the `webservice.backend` link on `edi.backend`, +no `component` dependency) and `edi_webservice_component_oca` (the +deprecated `component`-based send integration), both of which used to be +part of this module. A warning is logged on startup as a reminder. + +New code should depend on `edi_webservice_core_oca` directly, and +additionally on `edi_webservice_component_oca` only if it actually uses +the `component`-based `edi.webservice.send` integration. diff --git a/edi_webservice_oca/static/description/index.html b/edi_webservice_oca/static/description/index.html index dbe256146..c461af234 100644 --- a/edi_webservice_oca/static/description/index.html +++ b/edi_webservice_oca/static/description/index.html @@ -360,72 +360,40 @@ -
+
+

EDI WebService

- - -Odoo Community Association - -
-

EDI WebService

-

Beta License: AGPL-3 OCA/edi-framework Translate me on Weblate Try me on Runboat

-

Plug webservice module within EDI framework. Allows to configure attach -webservices on an EDI backend and/or on an exchange type.

+

Beta License: AGPL-3 OCA/edi-framework Translate me on Weblate Try me on Runboat

+

Deprecated as a direct dependency. This module is now just an +umbrella kept to preserve existing installations: it depends on both +edi_webservice_core_oca (the webservice.backend link on +edi.backend, no component dependency) and +edi_webservice_component_oca (the deprecated component-based +send integration), both of which used to be part of this module. A +warning is logged on startup as a reminder.

+

New code should depend on edi_webservice_core_oca directly, and +additionally on edi_webservice_component_oca only if it actually +uses the component-based edi.webservice.send integration.

Table of contents

-
-

Configuration

-

Go to “EDI -> Config -> Backends” and edit or create one. Find the tab -“Webservice” and add a webservice. On the webservice record you can -specify all the general parameters to connect to the service (see -webservice README for more details).

-

If you want to take full control on if/how the webservice is used you -can do it via exchange type’s advanced settings.

-

Hence, assuming your webservice has a URL configured as -`https://my.endpoint/%7Bpath%7D`:

-
-components:
-  send:
-    usage: webservice.send  # or any custom component usage inheriting from this
-    work_ctx:
-      webservice:
-        method: post  # mandatory
-        url_params:
-          path: endpoint1/foo
-
-

For each call related to this type, you’ll get a POST request against -https://my.endpoint/endpoint/foo.

-

url_params can contain all the keys need for URL interpolation.

-

In addition, you can user url to override the full url used for the -call per exchange type.

-

If you want to send data as bytes you can use the option send_as_bytes -like:

-
-[...]
-      webservice:
-        send_as_bytes: true
-[...]
-
-
-

Bug Tracker

+

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 @@ -433,23 +401,23 @@

Bug Tracker

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

-

Credits

+

Credits

-

Authors

+

Authors

  • Dixmit
  • Camptocamp
-

Maintainers

+

Maintainers

This module is maintained by the OCA.

Odoo Community Association @@ -464,6 +432,5 @@

Maintainers

-
From d5ad64abdd02588495965dc04a972a085c440e95 Mon Sep 17 00:00:00 2001 From: Simone Orsi Date: Fri, 25 Sep 2026 11:55:28 +0200 Subject: [PATCH 2/2] [CI] Update test-req --- test-requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/test-requirements.txt b/test-requirements.txt index a8133e4b5..a90c99ba3 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,2 +1,3 @@ odoo-test-helper xmlunittest +responses