Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
a9314b5
[MIG] base_external_system: re-apply 10.0 changes
NL66278 Apr 3, 2024
e985769
[ADD] base_external_system_http: new module
NL66278 Oct 30, 2023
bcc02da
[IMP] *_system_http: streamlined logging
NL66278 Nov 29, 2023
5c09d90
[IMP] base_external_system_http: pre-commit stuff
NL66278 Apr 3, 2024
e8280f9
[MIG] base_external_system_http: Migration to 16.0
NL66278 Apr 3, 2024
9696411
[ADD] base_external_system_oauth: new module
NL66278 Oct 19, 2023
6ddc8fb
[IMP] base_external_system_oauth: pre-commit stuff
NL66278 Apr 3, 2024
b8c7306
[MIG] base_external_system_oath: migration to 16.0
NL66278 Apr 3, 2024
1d79d9b
[IMP] *-system_oauth: provide tests
NL66278 Apr 4, 2024
64af32b
[ADD] base_external_system_ms_client_assertion: new module
NL66278 May 14, 2024
103787e
[TST] ..client_assertion: remove for now actual connection test
NL66278 May 15, 2024
27572cd
[FIX] base_..._oauth: no need for basic type provider.
NL66278 May 16, 2024
888b3e5
[IMP] base_..assertion: optionally use private_key value as is
NL66278 May 29, 2024
d3704d7
[IMP] base_...assertion: add the xt5 header
NL66278 Jun 13, 2024
f231f84
[FIX] retrieve headers from kwargs
ntsirintanis Aug 6, 2024
ec8f53a
[FIX] base_external_system_ms_client_assertion: type in _set_headers
ntsirintanis Sep 10, 2024
b201927
[FIX] base_external_system_oauth: add headers in kwargs
ntsirintanis Sep 18, 2024
dd805ad
[FIX] base_..._oauth: more pre-commit stuff
NL66278 Oct 7, 2024
3e1768d
[FIX] ..oauth: problem with setting token variable
NL66278 Oct 15, 2024
f395535
[FIX] base_external_system: previous_dir now also property
NL66278 Oct 22, 2024
b8dee6d
[FIX] base_external..: should be possible to override timeout
NL66278 Oct 22, 2024
80a9ae8
[FIX] base_external..: prevent excessive logging
NL66278 Oct 22, 2024
424dd6b
[FIX] restore basic oauth connection
NL66278 Nov 21, 2024
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
Loading