PyOdoo 0.9.2__tar.gz → 0.9.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyodoo-0.9.2 → pyodoo-0.9.3}/PKG-INFO +1 -1
- {pyodoo-0.9.2 → pyodoo-0.9.3}/PyOdoo.egg-info/PKG-INFO +1 -1
- {pyodoo-0.9.2 → pyodoo-0.9.3}/pyodoo/api.py +8 -2
- {pyodoo-0.9.2 → pyodoo-0.9.3}/pyodoo/constants.py +1 -1
- {pyodoo-0.9.2 → pyodoo-0.9.3}/pyodoo/implementation.py +1 -0
- {pyodoo-0.9.2 → pyodoo-0.9.3}/LICENSE +0 -0
- {pyodoo-0.9.2 → pyodoo-0.9.3}/PyOdoo.egg-info/SOURCES.txt +0 -0
- {pyodoo-0.9.2 → pyodoo-0.9.3}/PyOdoo.egg-info/dependency_links.txt +0 -0
- {pyodoo-0.9.2 → pyodoo-0.9.3}/PyOdoo.egg-info/requires.txt +0 -0
- {pyodoo-0.9.2 → pyodoo-0.9.3}/PyOdoo.egg-info/top_level.txt +0 -0
- {pyodoo-0.9.2 → pyodoo-0.9.3}/README.md +0 -0
- {pyodoo-0.9.2 → pyodoo-0.9.3}/pyodoo/__init__.py +0 -0
- {pyodoo-0.9.2 → pyodoo-0.9.3}/pyodoo/active_status_choice.py +0 -0
- {pyodoo-0.9.2 → pyodoo-0.9.3}/pyodoo/boolean_operator.py +0 -0
- {pyodoo-0.9.2 → pyodoo-0.9.3}/pyodoo/compare_type.py +0 -0
- {pyodoo-0.9.2 → pyodoo-0.9.3}/pyodoo/filter.py +0 -0
- {pyodoo-0.9.2 → pyodoo-0.9.3}/pyodoo/message_subtype.py +0 -0
- {pyodoo-0.9.2 → pyodoo-0.9.3}/pyodoo/model.py +0 -0
- {pyodoo-0.9.2 → pyodoo-0.9.3}/pyodoo/python_code.py +0 -0
- {pyodoo-0.9.2 → pyodoo-0.9.3}/pyodoo/samples/__init__.py +0 -0
- {pyodoo-0.9.2 → pyodoo-0.9.3}/pyodoo/samples/awaitable.py +0 -0
- {pyodoo-0.9.2 → pyodoo-0.9.3}/pyodoo/samples/contacts.py +0 -0
- {pyodoo-0.9.2 → pyodoo-0.9.3}/pyodoo/samples/contacts_async.py +0 -0
- {pyodoo-0.9.2 → pyodoo-0.9.3}/pyodoo/samples/python_code.py +0 -0
- {pyodoo-0.9.2 → pyodoo-0.9.3}/pyodoo/samples/sql_excel_query.py +0 -0
- {pyodoo-0.9.2 → pyodoo-0.9.3}/pyodoo/sql_excel_query.py +0 -0
- {pyodoo-0.9.2 → pyodoo-0.9.3}/pyodoo/transport.py +0 -0
- {pyodoo-0.9.2 → pyodoo-0.9.3}/pyodoo/v12/__init__.py +0 -0
- {pyodoo-0.9.2 → pyodoo-0.9.3}/pyproject.toml +0 -0
- {pyodoo-0.9.2 → pyodoo-0.9.3}/setup.cfg +0 -0
- {pyodoo-0.9.2 → pyodoo-0.9.3}/tests/test_compare_types.py +0 -0
- {pyodoo-0.9.2 → pyodoo-0.9.3}/tests/test_contacts.py +0 -0
- {pyodoo-0.9.2 → pyodoo-0.9.3}/tests/test_python_code.py +0 -0
- {pyodoo-0.9.2 → pyodoo-0.9.3}/tests/test_sql_excel_query.py +0 -0
|
@@ -61,6 +61,7 @@ class Api(object):
|
|
|
61
61
|
self.endpoint = self.endpoint[:-1]
|
|
62
62
|
# Specific implementations
|
|
63
63
|
if implementation in (Implementation.JSONRPC,
|
|
64
|
+
Implementation.JSON2,
|
|
64
65
|
Implementation.WEBRPC):
|
|
65
66
|
self.session = requests.Session()
|
|
66
67
|
|
|
@@ -97,8 +98,13 @@ class Api(object):
|
|
|
97
98
|
}
|
|
98
99
|
},
|
|
99
100
|
timeout=self.timeout)
|
|
100
|
-
|
|
101
|
-
|
|
101
|
+
response.raise_for_status()
|
|
102
|
+
result = response.json()
|
|
103
|
+
if not isinstance(result, dict):
|
|
104
|
+
raise RuntimeError('Invalid Odoo RPC response: not an object')
|
|
105
|
+
if 'error' in result:
|
|
106
|
+
raise RuntimeError(f'Odoo RPC error: {result["error"]}')
|
|
107
|
+
self.uid = result.get('result')
|
|
102
108
|
elif self.implementation == Implementation.WEBRPC:
|
|
103
109
|
# Authentication for WEB-RPC
|
|
104
110
|
response = self.session.post(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|