Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
0c43ff0
[MIG] base_external_system: re-apply 10.0 changes
NL66278 Apr 3, 2024
e4a1704
[ADD] base_external_system_http: new module
NL66278 Oct 30, 2023
1efbb01
[IMP] *_system_http: streamlined logging
NL66278 Nov 29, 2023
226d670
[IMP] base_external_system_http: pre-commit stuff
NL66278 Apr 3, 2024
50111c2
[MIG] base_external_system_http: Migration to 16.0
NL66278 Apr 3, 2024
c01b121
[ADD] base_external_system_oauth: new module
NL66278 Oct 19, 2023
f78b02f
[IMP] base_external_system_oauth: pre-commit stuff
NL66278 Apr 3, 2024
cbc5e04
[MIG] base_external_system_oath: migration to 16.0
NL66278 Apr 3, 2024
546a63f
[IMP] *-system_oauth: provide tests
NL66278 Apr 4, 2024
2a58db4
[ADD] base_external_system_ms_client_assertion: new module
NL66278 May 14, 2024
50e8276
[TST] ..client_assertion: remove for now actual connection test
NL66278 May 15, 2024
aa2b12c
[FIX] base_..._oauth: no need for basic type provider.
NL66278 May 16, 2024
992d43e
[IMP] base_..assertion: optionally use private_key value as is
NL66278 May 29, 2024
6e594f0
[IMP] base_...assertion: add the xt5 header
NL66278 Jun 13, 2024
db73160
[FIX] retrieve headers from kwargs
ntsirintanis Aug 6, 2024
e5064fc
[FIX] base_external_system_ms_client_assertion: type in _set_headers
ntsirintanis Sep 10, 2024
8738c56
[FIX] base_external_system_oauth: add headers in kwargs
ntsirintanis Sep 18, 2024
3c461c9
[FIX] base_..._oauth: more pre-commit stuff
NL66278 Oct 7, 2024
6c8d6b3
[FIX] ..oauth: problem with setting token variable
NL66278 Oct 15, 2024
272fb9f
[FIX] base_external_system: previous_dir now also property
NL66278 Oct 22, 2024
0087a90
[FIX] base_external..: should be possible to override timeout
NL66278 Oct 22, 2024
ea5edd1
[FIX] base_external..: prevent excessive logging
NL66278 Oct 22, 2024
cbe2e26
[FIX] restore basic oauth connection
NL66278 Nov 21, 2024
6475602
[ADD] *_system_http: add put interface
NL66278 Sep 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 65 additions & 30 deletions base_external_system/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Base External System
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:538c9c995cdcc3f95d664975e426c7a54638c5a728cef8253014ef178d29ec3f
!! source digest: sha256:199072a1b536548cfc88a3f85e558966096b960920cc11d93bdcbabcefc66bf3
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand All @@ -28,13 +28,13 @@ Base External System

|badge1| |badge2| |badge3| |badge4| |badge5|

This module provides an interface/adapter mechanism for the definition of remote
systems.
This module provides an interface/adapter mechanism for the definition
of remote systems.

Note that this module stores everything in plain text. In the interest of security,
it is recommended you use another module (such as `keychain` or `red_october` to
encrypt things like the password and private key). This is not done here in order
to not force a specific security method.
Note that this module stores everything in plain text. In the interest
of security, it is recommended you use another module (such as keychain
or red_october to encrypt things like the password and private key).
This is not done here in order to not force a specific security method.

**Table of contents**

Expand All @@ -46,41 +46,63 @@ Configuration

Configure external systems in Settings => Technical => External Systems

|Try me on Runbot|

.. |Try me on Runbot| image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:target: https://runbot.odoo-community.org/runbot/149/10.0

Usage
=====

The credentials for systems are stored in the ``external.system`` model, and are to
be configured by the user. This model is the unified interface for the underlying
adapters.
Implementation
--------------

The credentials for systems are stored in the ``external.system`` model,
and are to be configured by the user. This model is the unified
interface for the underlying adapters.

Using the Interface
~~~~~~~~~~~~~~~~~~~

Given an ``external.system`` singleton called ``external_system``, you would do the
following to get the underlying system client:
Given an ``external.system`` singleton called ``external_system``, you
would do the following to get the underlying system client:

.. code-block:: python
.. code:: python

with external_system.client() as client:
client.do_something()

The client will be destroyed once the context has completed. Destruction takes place
in the adapter's ``external_destroy_client`` method.
The client will be destroyed once the context has completed. Destruction
takes place in the adapter's ``external_destroy_client`` method.

The only unified aspect of this interface is the client connection itself. Other more
opinionated interface/adapter mechanisms can be implemented in other modules, such as
the file system interface in `OCA/server-tools/external_file_location
<https://github.com/OCA/server-tools/tree/9.0/external_file_location>`_.
The only unified aspect of this interface is the client connection
itself. Other more opinionated interface/adapter mechanisms can be
implemented in other modules, such as the file system interface in
`OCA/server-tools/external_file_location <https://github.com/OCA/server-tools/tree/9.0/external_file_location>`__.

Creating an Adapter
~~~~~~~~~~~~~~~~~~~

Modules looking to add an external system adapter should inherit the
``external.system.adapter`` model and override the following methods:

* ``external_get_client``: Returns a usable client for the system
* ``external_destroy_client``: Destroy the connection, if applicable. Does not need
to be defined if the connection destroys itself.
- ``external_get_client``: Returns a usable client for the system
- ``external_destroy_client``: Destroy the connection, if applicable.
Does not need to be defined if the connection destroys itself.

Changelog
=========

Version 16.0.1.0.0
------------------

Migration to 16.0

Version 10.0.2.0.0
------------------

Model base.external.system will be the only regular model, containing
all the data

Bug Tracker
===========
Expand All @@ -96,22 +118,27 @@ Credits
=======

Authors
~~~~~~~
-------

* LasLabs
* Therp BV

Contributors
~~~~~~~~~~~~
------------

- Dave Lasley dave@laslabs.com

- Therp BV https://therp.nl:

- Ronald Portier ronald@therp.nl

* Dave Lasley <dave@laslabs.com>
* Ronald Portier <ronald@therp.nl>
* `Tecnativa <https://www.tecnativa.com>`__:
- Tecnativa https://www.tecnativa.com:

* Alexandre Díaz
* César A. Sánchez
- Alexandre Díaz
- César A. Sánchez

Maintainers
~~~~~~~~~~~
-----------

This module is maintained by the OCA.

Expand All @@ -123,6 +150,14 @@ 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-NL66278| image:: https://github.com/NL66278.png?size=40px
:target: https://github.com/NL66278
:alt: NL66278

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-NL66278|

This module is part of the `OCA/server-backend <https://github.com/OCA/server-backend/tree/16.0/base_external_system>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 0 additions & 1 deletion base_external_system/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Copyright 2017 LasLabs Inc.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).

from . import models
5 changes: 4 additions & 1 deletion base_external_system/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2017 LasLabs Inc.
# Copyright 2024 Therp BV <https://therp.nl>.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).

{
Expand All @@ -7,7 +8,8 @@
"version": "16.0.1.0.0",
"category": "Base",
"website": "https://github.com/OCA/server-backend",
"author": "LasLabs, " "Odoo Community Association (OCA)",
"author": "LasLabs, Therp BV, Odoo Community Association (OCA)",
"maintainers": ["NL66278"],
"license": "LGPL-3",
"application": False,
"installable": True,
Expand All @@ -16,5 +18,6 @@
"demo/external_system_os_demo.xml",
"security/ir.model.access.csv",
"views/external_system_view.xml",
"views/ir_ui_menu.xml",
],
}
9 changes: 6 additions & 3 deletions base_external_system/demo/external_system_os_demo.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright 2017 LasLabs Inc.
Copyright 2023 Therp BV.
License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
-->
<odoo>
<record id="external_system_os" model="external.system.os">
<field name="name">Example OS Connection</field>
<field name="system_type">external.system.os</field>

<record id="external_system_os_demo" model="external.system">
<field name="name">Example OS Connection for Testing</field>
<field name="system_type">external.system.adapter.os</field>
<field name="remote_path">/tmp</field>
<field name="company_ids" eval="[(5, 0), (4, ref('base.main_company'))]" />
</record>

</odoo>
Loading