Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][MIG] base_external_system[_oauth|_http] #2925

Open
wants to merge 21 commits into
base: 16.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
7bda05f
[ADD] base_external_system_oauth: new module
NL66278 Oct 19, 2023
77c3854
[IMP] base_external_system_oauth: pre-commit stuff
NL66278 Apr 3, 2024
894ac3d
[ADD] base_external_system: Implement interface/adapter (#993)
lasley Oct 20, 2017
40cb625
[IMP] auth_session_timeout: Deprecate backwards compat + improve
lasley Nov 6, 2017
989c171
OCA Transbot updated translations from Transifex
oca-transbot Dec 2, 2017
bfe4e4d
OCA Transbot updated translations from Transifex
oca-transbot Jan 16, 2018
23e38c6
[UPD] Update base_external_system.pot
oca-travis Jun 24, 2018
d686c85
Translated using Weblate (Italian)
mymage May 24, 2023
fa59637
[IMP] base_external_system: refactor
NL66278 Oct 26, 2023
e93b8f6
[IMP] base_external_system: better test connection
NL66278 Oct 27, 2023
738333f
[IMP] base_external_system: black
NL66278 Oct 27, 2023
15ff0b8
[RFR] base_external_system: correct name for os adapter class
NL66278 Oct 30, 2023
3634ef5
[IMP] base_external_system: use lambda selection for system_type.
NL66278 Nov 2, 2023
05d5b6f
[FIX] base_external_system: load all descendent adapters
NL66278 Nov 14, 2023
3eec488
[IMP] base_external_system: pre-commit stuff
NL66278 Apr 3, 2024
fe481ba
[ADD] base_external_system_http: new module
NL66278 Oct 30, 2023
d4c7a63
[IMP] *_system_http: streamlined logging
NL66278 Nov 29, 2023
17e8ac2
[IMP] base_external_system_http: pre-commit stuff
NL66278 Apr 3, 2024
be1f022
[MIG] base_external_system: Migration to 16.0
NL66278 Apr 3, 2024
a727489
[MIG] base_external_system_http: Migration to 16.0
NL66278 Apr 3, 2024
07a2b9b
[FIX] migration corrections
ntsirintanis Apr 29, 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
155 changes: 155 additions & 0 deletions base_external_system/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
====================
Base External System
====================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:eccc14285e93f9b710d19e336684d8520aab330ca83b27ddff3f9e41eae77b8b
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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-LGPL--3-blue.png
: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--tools-lightgray.png?logo=github
:target: https://github.com/OCA/server-tools/tree/16.0/base_external_system
:alt: OCA/server-tools
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/server-tools-16-0/server-tools-16-0-base_external_system
: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-tools&target_branch=16.0
:alt: Try me on Runboat

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

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.

**Table of contents**

.. contents::
:local:

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
=====

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:

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

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
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-tools/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 <https://github.com/OCA/server-tools/issues/new?body=module:%20base_external_system%0Aversion:%2016.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.

Credits
=======

Authors
-------

* LasLabs
* Therp BV

Contributors
------------

- Dave Lasley <[email protected]>
- Ronald Portier <[email protected]>

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-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-tools <https://github.com/OCA/server-tools/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.
3 changes: 3 additions & 0 deletions base_external_system/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).

from . import models
21 changes: 21 additions & 0 deletions base_external_system/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2017 LasLabs Inc.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).

{
"name": "Base External System",
"summary": "Data models allowing for connection to external systems.",
"version": "16.0.1.0.0",
"category": "Base",
"website": "https://github.com/OCA/server-tools",
"author": "LasLabs, Therp BV, Odoo Community Association (OCA)",
"maintainers": ["NL66278"],
"license": "LGPL-3",
"application": False,
"installable": True,
"depends": ["base"],
"data": [
"demo/external_system_os_demo.xml",
"security/ir.model.access.csv",
"views/external_system_view.xml",
],
}
16 changes: 16 additions & 0 deletions base_external_system/demo/external_system_os_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +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_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