odoo-addon-base-external-api


Nameodoo-addon-base-external-api JSON
Version 17.0.1.1.0 PyPI version JSON
download
home_pagehttps://github.com/sygel-technology/sy-server-backend
SummaryTools to manage external api connections.
upload_time2025-08-21 05:38:58
maintainerNone
docs_urlNone
authorSygel, Odoo Community Association (OCA)
requires_python>=3.10
licenseAGPL-3
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            =================
Base External API
=================

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

.. |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-sygel--technology%2Fsy--server--backend-lightgray.png?logo=github
    :target: https://github.com/sygel-technology/sy-server-backend/tree/17.0/base_external_api
    :alt: sygel-technology/sy-server-backend

|badge1| |badge2| |badge3|

This module provides tools for other modules to use the requests library
for making external API calls.

With this module, you can:

- Create an external API record and configure its URL and
  authentication_method parameters
- Log every API call
- Make asynchronous calls

**Table of contents**

.. contents::
   :local:

Usage
=====

To use this module, you need to create a new module with:

1. A data file that creates an External API Config with an external ID.
2. A python file with code that gets the External API Config and uses it
   to make an external call with the call() or queued_call() methods.

Some use cases of this module would be sending every new res partner
record to, or sending every update in the price of the products, to a
remote API.

The code of the first example would look like this:

::

   <odoo noupdate="1">

       <record id="your_external_api_external_id" model="external.api.config">
           <field name="name">Your API Name</field>
           <field name="base_url">https://www.test.com</field>
       </record>

   </odoo>

::

   class ResPartner(models.Model):

       _inherit = "res.partner"

       def create(self, vals):
           recs = super().write(vals)
           if SYNCED_FIELDS.intersection(vals):
               for rec in recs:
                   partner_json = rec.json()  # Custom function to complete
                   self.env.ref(
                       'your_module.your_external_api_external_id'
                   ).queued_call(
                       method="post",
                       url="/partner/create",
                       data=partner_json
                   )
           return res

Known issues / Roadmap
======================

- Unit tests of the connection and authorization should be added
- The \_update_log() function should be removed, and the log should be
  created with all the values.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/sygel-technology/sy-server-backend/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/sygel-technology/sy-server-backend/issues/new?body=module:%20base_external_api%0Aversion:%2017.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
-------

* Sygel

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

- `Sygel <https://www.sygel.es>`__:

  - Alberto Martínez
  - Valentin Vinagre
  - Harald Panten

Maintainers
-----------

This module is part of the `sygel-technology/sy-server-backend <https://github.com/sygel-technology/sy-server-backend/tree/17.0/base_external_api>`_ project on GitHub.

You are welcome to contribute.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/sygel-technology/sy-server-backend",
    "name": "odoo-addon-base-external-api",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": null,
    "author": "Sygel, Odoo Community Association (OCA)",
    "author_email": "support@odoo-community.org",
    "download_url": null,
    "platform": null,
    "description": "=================\nBase External API\n=================\n\n.. \n   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n   !! This file is generated by oca-gen-addon-readme !!\n   !! changes will be overwritten.                   !!\n   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n   !! source digest: sha256:5167b5c09e714563b59f8a55cd944932d7e9e45c0cf9a47a4e4228a32429c7fc\n   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png\n    :target: https://odoo-community.org/page/development-status\n    :alt: Beta\n.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png\n    :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html\n    :alt: License: AGPL-3\n.. |badge3| image:: https://img.shields.io/badge/github-sygel--technology%2Fsy--server--backend-lightgray.png?logo=github\n    :target: https://github.com/sygel-technology/sy-server-backend/tree/17.0/base_external_api\n    :alt: sygel-technology/sy-server-backend\n\n|badge1| |badge2| |badge3|\n\nThis module provides tools for other modules to use the requests library\nfor making external API calls.\n\nWith this module, you can:\n\n- Create an external API record and configure its URL and\n  authentication_method parameters\n- Log every API call\n- Make asynchronous calls\n\n**Table of contents**\n\n.. contents::\n   :local:\n\nUsage\n=====\n\nTo use this module, you need to create a new module with:\n\n1. A data file that creates an External API Config with an external ID.\n2. A python file with code that gets the External API Config and uses it\n   to make an external call with the call() or queued_call() methods.\n\nSome use cases of this module would be sending every new res partner\nrecord to, or sending every update in the price of the products, to a\nremote API.\n\nThe code of the first example would look like this:\n\n::\n\n   <odoo noupdate=\"1\">\n\n       <record id=\"your_external_api_external_id\" model=\"external.api.config\">\n           <field name=\"name\">Your API Name</field>\n           <field name=\"base_url\">https://www.test.com</field>\n       </record>\n\n   </odoo>\n\n::\n\n   class ResPartner(models.Model):\n\n       _inherit = \"res.partner\"\n\n       def create(self, vals):\n           recs = super().write(vals)\n           if SYNCED_FIELDS.intersection(vals):\n               for rec in recs:\n                   partner_json = rec.json()  # Custom function to complete\n                   self.env.ref(\n                       'your_module.your_external_api_external_id'\n                   ).queued_call(\n                       method=\"post\",\n                       url=\"/partner/create\",\n                       data=partner_json\n                   )\n           return res\n\nKnown issues / Roadmap\n======================\n\n- Unit tests of the connection and authorization should be added\n- The \\_update_log() function should be removed, and the log should be\n  created with all the values.\n\nBug Tracker\n===========\n\nBugs are tracked on `GitHub Issues <https://github.com/sygel-technology/sy-server-backend/issues>`_.\nIn case of trouble, please check there if your issue has already been reported.\nIf you spotted it first, help us to smash it by providing a detailed and welcomed\n`feedback <https://github.com/sygel-technology/sy-server-backend/issues/new?body=module:%20base_external_api%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.\n\nDo not contact contributors directly about support or help with technical issues.\n\nCredits\n=======\n\nAuthors\n-------\n\n* Sygel\n\nContributors\n------------\n\n- `Sygel <https://www.sygel.es>`__:\n\n  - Alberto Mart\u00ednez\n  - Valentin Vinagre\n  - Harald Panten\n\nMaintainers\n-----------\n\nThis module is part of the `sygel-technology/sy-server-backend <https://github.com/sygel-technology/sy-server-backend/tree/17.0/base_external_api>`_ project on GitHub.\n\nYou are welcome to contribute.\n",
    "bugtrack_url": null,
    "license": "AGPL-3",
    "summary": "Tools to manage external api connections.",
    "version": "17.0.1.1.0",
    "project_urls": {
        "Homepage": "https://github.com/sygel-technology/sy-server-backend"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3af467ab0956cd99535eabc3ce4dff9c6edc52b5a8c6ff6d445c251aed2bbd62",
                "md5": "c6ad1ba02aef2655cbe3efa32a580c68",
                "sha256": "9a9242aee6af49275e09a4f01bab707249d5356be49b8f4c0d3d86bad1c2f214"
            },
            "downloads": -1,
            "filename": "odoo_addon_base_external_api-17.0.1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c6ad1ba02aef2655cbe3efa32a580c68",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 48390,
            "upload_time": "2025-08-21T05:38:58",
            "upload_time_iso_8601": "2025-08-21T05:38:58.200344Z",
            "url": "https://files.pythonhosted.org/packages/3a/f4/67ab0956cd99535eabc3ce4dff9c6edc52b5a8c6ff6d445c251aed2bbd62/odoo_addon_base_external_api-17.0.1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-21 05:38:58",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "sygel-technology",
    "github_project": "sy-server-backend",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "odoo-addon-base-external-api"
}
        
Elapsed time: 1.48519s