Skip to content

Commit

Permalink
[MIG] webservice: Migration to V12
Browse files Browse the repository at this point in the history
  • Loading branch information
JordiMForgeFlow committed Nov 27, 2024
1 parent 42842e0 commit 4a8168f
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 378 deletions.
2 changes: 1 addition & 1 deletion webservice/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"name": "WebService",
"summary": """
Defines webservice abstract definition to be used generally""",
"version": "13.0.1.0.0",
"version": "12.0.1.0.0",
"license": "AGPL-3",
"development_status": "Production/Stable",
"maintainers": ["etobella"],
Expand Down
2 changes: 1 addition & 1 deletion webservice/components/request_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def _get_url(self, url=None, url_params=None, **kwargs):
url = self.collection.url

Check warning on line 71 in webservice/components/request_adapter.py

View check run for this annotation

Codecov / codecov/patch

webservice/components/request_adapter.py#L71

Added line #L71 was not covered by tests
elif not url.startswith(self.collection.url):
if not url.startswith("http"):
url = f"{self.collection.url.rstrip('/')}/{url.lstrip('/')}"
url = "{collection_url}/{url}".format(collection_url=self.collection.url.rstrip('/'), url=url.lstrip('/'))

Check warning on line 74 in webservice/components/request_adapter.py

View check run for this annotation

Codecov / codecov/patch

webservice/components/request_adapter.py#L74

Added line #L74 was not covered by tests
else:
# TODO: if url is given, we should validate the domain
# to avoid abusing a webservice backend for different calls.
Expand Down
2 changes: 1 addition & 1 deletion webservice/security/ir_rule.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
<field name="model_id" ref="model_webservice_backend" />
<field
name="domain_force"
>['|',('company_id','=',False),('company_id', 'in', company_ids)]</field>
>['|',('company_id','=',False), ('company_id', 'child_of', [user.company_id.id])]</field>
</record>
</odoo>
3 changes: 2 additions & 1 deletion webservice/tests/common.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Copyright 2020 Creu Blanca
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

import mock
from contextlib import contextmanager
from odoo.tests.common import tagged

from odoo.addons.component.tests.common import TransactionComponentCase
Expand Down
302 changes: 0 additions & 302 deletions webservice/tests/test_oauth2.py

This file was deleted.

Loading

0 comments on commit 4a8168f

Please sign in to comment.