Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
861ce10
[ADD] webservice_server_env: make server_environment an optional depe…
dreispt Apr 28, 2024
d18744b
[ADD] webservice
etobella Dec 10, 2020
2513526
[UPD] Update webservice.pot
oca-travis Mar 15, 2021
5f39951
[UPD] README.rst
OCA-git-bot Mar 15, 2021
48416a1
[MIG] webservice: Migration to 14.0
etobella May 6, 2021
435e011
[UPD] Update webservice.pot
oca-travis May 14, 2021
b54afad
[UPD] README.rst
OCA-git-bot May 14, 2021
46772ec
Added translation using Weblate (French)
Yvesldff Jun 17, 2021
d3a96aa
Translated using Weblate (French)
Yvesldff Jun 17, 2021
622512c
[FIX] webservice: server.env.mixin needs to be inherited
LoisRForgeFlow Jun 21, 2021
a919c00
[UPD] Update webservice.pot
oca-travis Jul 30, 2021
c95541e
webservice 14.0.1.0.1
OCA-git-bot Jul 30, 2021
0604f7e
Update translation files
oca-transbot Jul 30, 2021
d4a13f3
[MIG] webservice: Migration to 15.0
JasminSForgeFlow Feb 15, 2022
0cf5167
[UPD] Update webservice.pot
Feb 16, 2022
80cb64f
[UPD] README.rst
OCA-git-bot Feb 16, 2022
a6cfbaf
[UPD] Update webservice.pot
Apr 7, 2022
a1154c1
Update translation files
oca-transbot Apr 8, 2022
fd42dff
webservice: move to web-api
simahawk Aug 10, 2022
634a7f9
[UPD] README.rst
OCA-git-bot Aug 10, 2022
4d878cb
[MIG] webservice: Migration to 16.0
EvaSForgeFlow Jul 10, 2023
7d79363
webservice: improve call
simahawk Aug 27, 2022
a2d4287
webservice: add api key and public auth support
simahawk Sep 1, 2022
cc37c21
[UPD] Update webservice.pot
Jul 25, 2023
569d100
[UPD] README.rst
OCA-git-bot Jul 25, 2023
102dfc6
Update translation files
weblate Jul 25, 2023
f7e00fe
[UPD] README.rst
OCA-git-bot Sep 3, 2023
2a82b22
Added translation using Weblate (Italian)
mymage Nov 27, 2023
81b4be5
Translated using Weblate (Italian)
mymage Nov 27, 2023
0e2bc95
Translated using Weblate (Italian)
mymage Nov 28, 2023
1da94e2
Translated using Weblate (Italian)
mymage Jan 5, 2024
e754296
[IMP] webservice: multi-company
JordiMForgeFlow Feb 2, 2024
7377095
[UPD] Update webservice.pot
Feb 5, 2024
ca4ff7d
[BOT] post-merge updates
OCA-git-bot Feb 5, 2024
5e09183
Update translation files
weblate Feb 5, 2024
7d2ce8a
Translated using Weblate (Italian)
mymage Feb 8, 2024
bc236f8
[IMP] webservice: combine the url with collection's url
gurneyalex Feb 28, 2024
ddcefc4
[BOT] post-merge updates
OCA-git-bot Apr 8, 2024
faec4a1
[IMP] webservice: add support for oauth2
gurneyalex Feb 28, 2024
a90079d
add support for oauth2 web application flow
gurneyalex Apr 16, 2024
e5915e5
Translated using Weblate (Italian)
mymage May 13, 2024
9c90a0b
[UPD] Update webservice.pot
May 14, 2024
1dc30be
[BOT] post-merge updates
OCA-git-bot May 14, 2024
620259c
Update translation files
weblate May 14, 2024
e918b4e
Translated using Weblate (Italian)
mymage May 23, 2024
df2f375
[FIX] webservice: WARNING message in logs
gurneyalex May 31, 2024
3e31230
[BOT] post-merge updates
OCA-git-bot Sep 16, 2024
be46d29
[IMP] webservice: pre-commit auto fixes
SilvioC2C Sep 17, 2024
226971f
[MIG] webservice: Migration to 17.0
SilvioC2C Sep 17, 2024
8aa8921
[IMP] webservice: improve tests
SilvioC2C Sep 17, 2024
ce165cd
[UPD] Update webservice.pot
Sep 18, 2024
e6a6c99
[BOT] post-merge updates
OCA-git-bot Sep 18, 2024
4885962
Update translation files
weblate Sep 18, 2024
272bf95
Translated using Weblate (Italian)
mymage Sep 19, 2024
b218d96
[IMP] webservice: pre-commit stuff
JordiMForgeFlow Oct 23, 2024
9dac56e
[MIG] webservice: Migration to V18
JordiMForgeFlow Oct 23, 2024
82e57f8
[IMP] webservice: allow empty content type
JordiMForgeFlow Oct 24, 2024
44f3876
[IMP] webservice: do not log warning in tests
JordiMForgeFlow Oct 25, 2024
3e78344
[IMP] webservice: allow to return response object on http calls
JordiMForgeFlow Dec 18, 2024
a1a82a0
[UPD] Update webservice.pot
Dec 18, 2024
05ea335
[BOT] post-merge updates
OCA-git-bot Dec 18, 2024
9e28020
Update translation files
weblate Dec 18, 2024
6948adb
webservice: log calls
simahawk Oct 3, 2022
1c804a4
[BOT] post-merge updates
OCA-git-bot Jan 14, 2025
dd6eecd
Translated using Weblate (Italian)
mymage Jan 28, 2025
273bec4
Translated using Weblate (Italian)
mymage May 16, 2025
19a1e51
[REF] webservice: server_environment should not be a required dependency
dreispt Apr 28, 2024
946f8e7
[IMP] webservice: pre-commit auto fixes
AaronHForgeFlow Mar 24, 2026
a5739f6
[IMP] webservice_server_env: pre-commit auto fixes
AaronHForgeFlow Mar 24, 2026
22a9a5e
[MIG] webservice: Migration to v19
AaronHForgeFlow Mar 24, 2026
a095a2e
[MIG] webservice_server_env Migration to v19
AaronHForgeFlow Mar 24, 2026
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
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# generated from manifests external_dependencies
oauthlib
requests-oauthlib
responses
94 changes: 94 additions & 0 deletions webservice/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

==========
WebService
==========

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

.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
:target: https://odoo-community.org/page/development-status
:alt: Production/Stable
.. |badge2| image:: https://img.shields.io/badge/license-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%2Fweb--api-lightgray.png?logo=github
:target: https://github.com/OCA/web-api/tree/19.0/webservice
:alt: OCA/web-api
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/web-api-19-0/web-api-19-0-webservice
: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/web-api&target_branch=19.0
:alt: Try me on Runboat

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

This module creates WebService frameworks to be used globally.

The module introduces support for HTTP Request protocol. The webservice
HTTP call returns by default the content of the response. A context
'content_only' can be passed to get the full response object.

**Table of contents**

.. contents::
:local:

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

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

* Creu Blanca
* Camptocamp

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

- Enric Tobella <etobella@creublanca.es>
- Alexandre Fayolle <alexandre.fayolle@camptocamp.com>

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

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

|maintainer-etobella|

This module is part of the `OCA/web-api <https://github.com/OCA/web-api/tree/19.0/webservice>`_ 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 webservice/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from . import components
from . import models
from . import controllers
23 changes: 23 additions & 0 deletions webservice/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2020 Creu Blanca
# Copyright 2022 Camptocamp SA
# @author Simone Orsi <simahawk@gmail.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "WebService",
"summary": """Defines webservice abstract definition to be used generally""",
"version": "19.0.1.1.0",
"license": "AGPL-3",
"development_status": "Production/Stable",
"maintainers": ["etobella"],
"author": "Creu Blanca, Camptocamp, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/web-api",
"depends": ["component"],
"external_dependencies": {"python": ["requests-oauthlib", "oauthlib", "responses"]},
"data": [
"security/ir.model.access.csv",
"security/ir_rule.xml",
"views/webservice_backend.xml",
],
"demo": [],
}
2 changes: 2 additions & 0 deletions webservice/components/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import base_adapter
from . import request_adapter
20 changes: 20 additions & 0 deletions webservice/components/base_adapter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2020 Creu Blanca
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo.addons.component.core import AbstractComponent


class BaseWebServiceAdapter(AbstractComponent):
_name = "base.webservice.adapter"
_collection = "webservice.backend"
_webservice_protocol = False
_usage = "webservice.request"

@classmethod
def _component_match(cls, work, usage=None, model_name=None, **kw):
"""Override to customize match.

Registry lookup filtered by usage and model_name when landing here.
Now, narrow match to `_match_attrs` attributes.
"""
return kw.get("webservice_protocol") in (None, cls._webservice_protocol)
Loading
Loading