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.
Files changed (34) hide show
  1. {pyodoo-0.9.2 → pyodoo-0.9.3}/PKG-INFO +1 -1
  2. {pyodoo-0.9.2 → pyodoo-0.9.3}/PyOdoo.egg-info/PKG-INFO +1 -1
  3. {pyodoo-0.9.2 → pyodoo-0.9.3}/pyodoo/api.py +8 -2
  4. {pyodoo-0.9.2 → pyodoo-0.9.3}/pyodoo/constants.py +1 -1
  5. {pyodoo-0.9.2 → pyodoo-0.9.3}/pyodoo/implementation.py +1 -0
  6. {pyodoo-0.9.2 → pyodoo-0.9.3}/LICENSE +0 -0
  7. {pyodoo-0.9.2 → pyodoo-0.9.3}/PyOdoo.egg-info/SOURCES.txt +0 -0
  8. {pyodoo-0.9.2 → pyodoo-0.9.3}/PyOdoo.egg-info/dependency_links.txt +0 -0
  9. {pyodoo-0.9.2 → pyodoo-0.9.3}/PyOdoo.egg-info/requires.txt +0 -0
  10. {pyodoo-0.9.2 → pyodoo-0.9.3}/PyOdoo.egg-info/top_level.txt +0 -0
  11. {pyodoo-0.9.2 → pyodoo-0.9.3}/README.md +0 -0
  12. {pyodoo-0.9.2 → pyodoo-0.9.3}/pyodoo/__init__.py +0 -0
  13. {pyodoo-0.9.2 → pyodoo-0.9.3}/pyodoo/active_status_choice.py +0 -0
  14. {pyodoo-0.9.2 → pyodoo-0.9.3}/pyodoo/boolean_operator.py +0 -0
  15. {pyodoo-0.9.2 → pyodoo-0.9.3}/pyodoo/compare_type.py +0 -0
  16. {pyodoo-0.9.2 → pyodoo-0.9.3}/pyodoo/filter.py +0 -0
  17. {pyodoo-0.9.2 → pyodoo-0.9.3}/pyodoo/message_subtype.py +0 -0
  18. {pyodoo-0.9.2 → pyodoo-0.9.3}/pyodoo/model.py +0 -0
  19. {pyodoo-0.9.2 → pyodoo-0.9.3}/pyodoo/python_code.py +0 -0
  20. {pyodoo-0.9.2 → pyodoo-0.9.3}/pyodoo/samples/__init__.py +0 -0
  21. {pyodoo-0.9.2 → pyodoo-0.9.3}/pyodoo/samples/awaitable.py +0 -0
  22. {pyodoo-0.9.2 → pyodoo-0.9.3}/pyodoo/samples/contacts.py +0 -0
  23. {pyodoo-0.9.2 → pyodoo-0.9.3}/pyodoo/samples/contacts_async.py +0 -0
  24. {pyodoo-0.9.2 → pyodoo-0.9.3}/pyodoo/samples/python_code.py +0 -0
  25. {pyodoo-0.9.2 → pyodoo-0.9.3}/pyodoo/samples/sql_excel_query.py +0 -0
  26. {pyodoo-0.9.2 → pyodoo-0.9.3}/pyodoo/sql_excel_query.py +0 -0
  27. {pyodoo-0.9.2 → pyodoo-0.9.3}/pyodoo/transport.py +0 -0
  28. {pyodoo-0.9.2 → pyodoo-0.9.3}/pyodoo/v12/__init__.py +0 -0
  29. {pyodoo-0.9.2 → pyodoo-0.9.3}/pyproject.toml +0 -0
  30. {pyodoo-0.9.2 → pyodoo-0.9.3}/setup.cfg +0 -0
  31. {pyodoo-0.9.2 → pyodoo-0.9.3}/tests/test_compare_types.py +0 -0
  32. {pyodoo-0.9.2 → pyodoo-0.9.3}/tests/test_contacts.py +0 -0
  33. {pyodoo-0.9.2 → pyodoo-0.9.3}/tests/test_python_code.py +0 -0
  34. {pyodoo-0.9.2 → pyodoo-0.9.3}/tests/test_sql_excel_query.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyOdoo
3
- Version: 0.9.2
3
+ Version: 0.9.3
4
4
  Summary: API for Odoo
5
5
  Author-email: Fabio Castelli <muflone@muflone.com>
6
6
  License-Expression: GPL-3.0-or-later
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyOdoo
3
- Version: 0.9.2
3
+ Version: 0.9.3
4
4
  Summary: API for Odoo
5
5
  Author-email: Fabio Castelli <muflone@muflone.com>
6
6
  License-Expression: GPL-3.0-or-later
@@ -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
- result = response.json() if response else None
101
- self.uid = result['result'] if result else None
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(
@@ -19,7 +19,7 @@
19
19
  ##
20
20
 
21
21
  APP_NAME = 'PyOdoo'
22
- APP_VERSION = '0.9.2'
22
+ APP_VERSION = '0.9.3'
23
23
  APP_DESCRIPTION = 'API for Odoo'
24
24
  APP_DOMAIN = 'pyodoo'
25
25
  APP_ID = f'{APP_DOMAIN}.muflone.com'
@@ -24,4 +24,5 @@ class Implementation(object):
24
24
  """
25
25
  XMLRPC = 'xmlrpc'
26
26
  JSONRPC = 'jsonrpc'
27
+ JSON2 = 'json2'
27
28
  WEBRPC = 'webrpc'
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