Skip to content

Commit

Permalink
Release 1.1.0
Browse files Browse the repository at this point in the history
- Added support (tests) of Odoo 13.0, Odoo 14.0 and python3.8
- Added tests for batch create in Odoo 12.0+
- Support for Odoo 7.0 is now deprecated and will be completely removed in one
  of next versions
- Odoo 8.0 and 9.0 now supported, but not tested.
  • Loading branch information
katyukha committed Feb 9, 2021
2 parents 37579e5 + cb1eec2 commit fb2ad21
Show file tree
Hide file tree
Showing 15 changed files with 191 additions and 83 deletions.
47 changes: 22 additions & 25 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,16 @@ flake8:

.tests-default: &test-default-definition
services:
- name: registry.gitlab.com/katyukha/odoo-ci:7.0
alias: odoo7
- name: registry.gitlab.com/katyukha/odoo-ci:8.0
alias: odoo8
- name: registry.gitlab.com/katyukha/odoo-ci:9.0
alias: odoo9
- name: registry.gitlab.com/katyukha/odoo-ci:10.0
alias: odoo10
- name: registry.gitlab.com/katyukha/odoo-ci:11.0
- name: registry.crnd.pro/crnd-opensource/docker/odoo-ci-x:11.0-ci
alias: odoo11
- name: registry.gitlab.com/katyukha/odoo-ci:12.0
- name: registry.crnd.pro/crnd-opensource/docker/odoo-ci-x:12.0-ci
alias: odoo12
- name: registry.crnd.pro/crnd-opensource/docker/odoo-ci-x:13.0-ci
alias: odoo13
- name: registry.crnd.pro/crnd-opensource/docker/odoo-ci-x:14.0-ci
alias: odoo14
variables:
ODOO_TEST_SUPER_PASSWORD: admin

Expand All @@ -44,17 +42,16 @@ flake8:
before_script:
- pip install -r requirements.txt -r requirements-test.txt
script:
- ODOO_TEST_HOST=odoo7 ODOO_TEST_PROTOCOL="xml-rpc" coverage run -p setup.py test
- ODOO_TEST_HOST=odoo8 ODOO_TEST_PROTOCOL="xml-rpc" coverage run -p setup.py test
- ODOO_TEST_HOST=odoo8 ODOO_TEST_PROTOCOL="json-rpc" coverage run -p setup.py test
- ODOO_TEST_HOST=odoo9 ODOO_TEST_PROTOCOL="xml-rpc" coverage run -p setup.py test
- ODOO_TEST_HOST=odoo9 ODOO_TEST_PROTOCOL="json-rpc" coverage run -p setup.py test
- ODOO_TEST_HOST=odoo10 ODOO_TEST_PROTOCOL="xml-rpc" coverage run -p setup.py test
- ODOO_TEST_HOST=odoo10 ODOO_TEST_PROTOCOL="json-rpc" coverage run -p setup.py test
- ODOO_TEST_HOST=odoo11 ODOO_TEST_PROTOCOL="xml-rpc" coverage run -p setup.py test
- ODOO_TEST_HOST=odoo11 ODOO_TEST_PROTOCOL="json-rpc" coverage run -p setup.py test
- ODOO_TEST_HOST=odoo12 ODOO_TEST_PROTOCOL="xml-rpc" coverage run -p setup.py test
- ODOO_TEST_HOST=odoo12 ODOO_TEST_PROTOCOL="json-rpc" coverage run -p setup.py test
- ODOO_TEST_HOST=odoo13 ODOO_TEST_PROTOCOL="xml-rpc" coverage run -p setup.py test
- ODOO_TEST_HOST=odoo13 ODOO_TEST_PROTOCOL="json-rpc" coverage run -p setup.py test
- ODOO_TEST_HOST=odoo14 ODOO_TEST_PROTOCOL="xml-rpc" coverage run -p setup.py test
- ODOO_TEST_HOST=odoo14 ODOO_TEST_PROTOCOL="json-rpc" coverage run -p setup.py test
- coverage combine
- coverage report --fail-under=90
after_script:
Expand All @@ -70,14 +67,6 @@ tests-py27:
image: python:2.7
<<: *test-default-definition

tests-py33:
image: python:3.3
<<: *test-default-definition

tests-py34:
image: python:3.4
<<: *test-default-definition

tests-py35:
image: python:3.5
<<: *test-default-definition
Expand All @@ -90,21 +79,29 @@ tests-py37:
image: python:3.7
<<: *test-default-definition

tests-py38:
image: python:3.8
<<: *test-default-definition

tests-py39:
image: python:3.9
<<: *test-default-definition

coverage:
image: python:3.7
stage: coverage
dependencies:
- tests-py27
- tests-py33
- tests-py34
- tests-py35
- tests-py36
- tests-py37
- tests-py38
- tests-py39
before_script:
- pip install coverage
script:
- coverage combine .coverage_tests-py27 .coverage_tests-py33 .coverage_tests-py34 .coverage_tests-py35 .coverage_tests-py36 .coverage_tests-py37
- coverage report --fail-under=95
- coverage combine .coverage_tests-py27 .coverage_tests-py35 .coverage_tests-py36 .coverage_tests-py37 .coverage_tests-py38 .coverage_tests-py39
- coverage report --fail-under=90
after_script:
- coverage html
coverage: '/^TOTAL\s+\d+\s+\d+\s+(\d+\%)/'
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Last changes
============

Release 1.1.0
-------------

- Added support (tests) of Odoo 13.0, Odoo 14.0 and python3.8
- Added tests for batch create in Odoo 12.0+
- Support for Odoo 7.0 is now deprecated and will be completely removed in one
of next versions
- Odoo 8.0 and 9.0 now supported, but not tested.

Release 1.0.0
-------------

Expand Down
33 changes: 29 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Odoo internal code to perform operations on **Odoo** objects hiding
Features
~~~~~~~~

- *Python 3.3+* support
- *Python 3.5+* support
- You can call any public method on any OpenERP / Odoo object including:
*read*, *search*, *write*, *unlink* and others
- Have *a lot of speed optimizations* (caching, read only requested fields,
Expand Down Expand Up @@ -79,7 +79,7 @@ Quick example
print(client.user.name)
# simple rpc calls
client.execute('res.partner', 'read', [user.partner_id.id])
client.execute('res.partner', 'read', [client.user.partner_id.id])
# Model browsing
SaleOrder = client['sale.order']
Expand All @@ -96,8 +96,8 @@ Supported Odoo server versions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Tested with:
- Odoo versions: *7.0*, *8.0*, *9.0*, *10.0*, *11.0*, *12.0*
- Python versions: *2.7*, *3.3*, *3.4*, *3.5*, *3.6*, *3.7*
- Odoo versions: *10.0*, *11.0*, *12.0*, *13.0*, *14.0*
- Python versions: *2.7*, *3.5*, *3.6*, *3.7*, *3.8*, *3.9*


Install
Expand All @@ -107,6 +107,31 @@ This project is present on `PyPI <https://pypi.python.org/pypi/odoo_rpc_client/>
so it could be installed via PIP::

pip install odoo_rpc_client

Yodoo Cockpit - Manage your odoo infrastructure via odoo
--------------------------------------------------------

.. image:: https://crnd.pro/web/image/18846/banner_2_4_gif_animation_cut.gif
:target: https://crnd.pro/yodoo-cockpit
:alt: Yodoo Cockpit - Manage your odoo infrastructure via odoo

Take a look at `Yodoo Cockpit <https://crnd.pro/yodoo-cockpit>`__ project, and discover the easiest way to manage your odoo installation.
Just short notes about `Yodoo Cockpit <https://crnd.pro/yodoo-cockpit`__:
- start new production-ready odoo instance in 1-2 minutes.
- add custom addons to your odoo instances in 5-10 minutes.
- out-of-the-box email configuration: just press button and add some records to your DNS, and get a working email
- make your odoo instance available to external world (internet) in 30 seconds (just add single record in your DNS)

If you have any questions, then contact us at `info@crnd.pro <mailto:info@crnd.pro>`__, so we could schedule online-demonstration.

Level up your service quality
-----------------------------

Level up your service with our `Helpdesk <https://crnd.pro/solutions/helpdesk>`__ / `Service Desk <https://crnd.pro/solutions/service-desk>`__ / `ITSM <https://crnd.pro/itsm>`__ solution.

Just test it at `yodoo.systems <https://yodoo.systems/saas/templates>`__: choose template you like, and start working.

Test all available features of `Bureaucrat ITSM <https://crnd.pro/itsm>`__ with `this template <https://yodoo.systems/saas/template/bureaucrat-itsm-demo-data-95>`__.


Usage
Expand Down
30 changes: 27 additions & 3 deletions docs/source/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Odoo internal code to perform operations on **Odoo** objects hiding
Features
~~~~~~~~

- *Python 3.3+* support
- *Python 3.5+* support
- You can call any public method on any OpenERP / Odoo object including:
*read*, *search*, *write*, *unlink* and others
- Have *a lot of speed optimizations* (caching, read only requested fields,
Expand Down Expand Up @@ -86,8 +86,8 @@ Supported Odoo server versions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Tested with:
- Odoo versions: *7.0*, *8.0*, *9.0*, *10.0*, *11.0*, *12.0*
- Python versions: *2.7*, *3.3*, *3.4*, *3.5*, *3.6*, *3.7*
- Odoo versions: *10.0*, *11.0*, *12.0*, *13.0*, *14.0*
- Python versions: *2.7*, *3.5*, *3.6*, *3.7*, *3.8*, *3.9*


Install
Expand All @@ -98,6 +98,30 @@ so it could be installed via PIP::

pip install odoo_rpc_client
Yodoo Cockpit - Manage your odoo infrastructure via odoo
--------------------------------------------------------

.. image:: https://crnd.pro/web/image/18846/banner_2_4_gif_animation_cut.gif
:target: https://crnd.pro/yodoo-cockpit
:alt: Yodoo Cockpit - Manage your odoo infrastructure via odoo

Take a look at `Yodoo Cockpit <https://crnd.pro/yodoo-cockpit>`__ project, and discover the easiest way to manage your odoo installation.
Just short notes about `Yodoo Cockpit <https://crnd.pro/yodoo-cockpit`__:
- start new production-ready odoo instance in 1-2 minutes.
- add custom addons to your odoo instances in 5-10 minutes.
- out-of-the-box email configuration: just press button and add some records to your DNS, and get a working email
- make your odoo instance available to external world (internet) in 30 seconds (just add single record in your DNS)

If you have any questions, then contact us at `info@crnd.pro <mailto:info@crnd.pro>`__, so we could schedule online-demonstration.

Level up your service quality
-----------------------------

Level up your service with our `Helpdesk <https://crnd.pro/solutions/helpdesk>`__ / `Service Desk <https://crnd.pro/solutions/service-desk>`__ / `ITSM <https://crnd.pro/itsm>`__ solution.

Just test it at `yodoo.systems <https://yodoo.systems/saas/templates>`__: choose template you like, and start working.

Test all available features of `Bureaucrat ITSM <https://crnd.pro/itsm>`__ with `this template <https://yodoo.systems/saas/template/bureaucrat-itsm-demo-data-95>`__.

Usage
-----
Expand Down
3 changes: 3 additions & 0 deletions odoo_rpc_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,9 @@ def database_version(self):
def registered_objects(self):
""" List of registered in Odoo database objects
WARNING: This method is deprecated, and will not be working
for Odoo 14.0+
:rtype: list
"""
return self.services['object'].get_registered_objects()
Expand Down
30 changes: 16 additions & 14 deletions odoo_rpc_client/orm/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@

""" This module contains classes and logic to handle operations on records
"""
import six
import abc
import numbers
import functools
import collections
from extend_me import (ExtensibleType,
ExtensibleByHashType)
from six.moves import collections_abc


from ..utils import (wpartial,
normalizeSField,
Expand All @@ -20,15 +29,6 @@
Cache)


import six
import abc
import numbers
import functools
import collections
from extend_me import (ExtensibleType,
ExtensibleByHashType)


__all__ = (
'Record',
'ObjectRecords',
Expand Down Expand Up @@ -246,7 +246,7 @@ def _get_many2one_rel_obj(self, name, rel_data, cached=True):
if rel_data:
# Do not forged about relations in form [id, name]
rel_id = (rel_data[0]
if isinstance(rel_data, collections.Iterable)
if isinstance(rel_data, collections_abc.Iterable)
else rel_data)

rel_obj = self._service.get_obj(
Expand Down Expand Up @@ -460,7 +460,7 @@ def get_record_list(obj, ids=None, fields=None, cache=None, context=None):
# list with diferent cache
@six.python_2_unicode_compatible
class RecordList(six.with_metaclass(RecordListMeta,
collections.MutableSequence,
collections_abc.MutableSequence,
DirMixIn)):
"""Class to hold list of records with some extra functionality
Expand Down Expand Up @@ -644,7 +644,8 @@ def __repr__(self):
return str(self)

def refresh(self):
""" Cleanup data caches. next try to get data will cause rereading of it
""" Cleanup data caches.
Next try to get data will cause rereading of it
:returns: self
:rtype: instance of RecordList
Expand Down Expand Up @@ -1038,7 +1039,7 @@ def read_records(self, ids, fields=None, context=None, cache=None):
if fields is not None:
record.read(fields) # read specified fields
return record
if isinstance(ids, collections.Iterable):
if isinstance(ids, collections_abc.Iterable):
return get_record_list(self, ids, fields=fields,
cache=cache, context=context)

Expand All @@ -1053,8 +1054,9 @@ def create_record(self, vals, context=None, cache=None):
:param Cache cache: cache to add created record to.
if None is passed, then new cache
will be created.
:return: Record instance of created record
:return: Record or RecordList instance of created records
:rtype: odoo_rpc_client.orm.record.Record
:rtype: odoo_rpc_client.orm.record.RecordList
For example:
Expand Down
3 changes: 0 additions & 3 deletions odoo_rpc_client/orm/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ def get_obj(self, object_name):
if object_name in self.__objects:
return self.__objects[object_name]

if object_name not in self.get_registered_objects():
raise ValueError("There is no object named '%s'" % object_name)

obj = get_object(self, object_name)
self.__objects[object_name] = obj
return obj
Expand Down
2 changes: 1 addition & 1 deletion odoo_rpc_client/service/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def dump_db(self, password, db, **kwargs):

# Ensure returned data is not unicode, but bytes
if isinstance(dump_data, six.text_type):
dump_data = dump_data
dump_data = dump_data.encode('utf-8')

return dump_data

Expand Down
11 changes: 11 additions & 0 deletions odoo_rpc_client/service/object.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,15 @@ def execute_wkf(self, object_name, signal, object_id):
def _get_registered_objects(self):
""" Implementation of get registered models (objects)
Could be overridden by extensions
WARNING: This method is deprecated, and will not be working
for Odoo 14.0+
"""
if self.client.server_version >= parse_version('14.0'):
# Starting from Odoo 14.0 this method will not work, because they
# have blocked access to ir.model model
return []

if self.client.server_version > parse_version('8.0'):
read = self.execute('ir.model', 'search_read',
domain=[], fields=['model'])
Expand All @@ -73,6 +81,9 @@ def _get_registered_objects(self):

def get_registered_objects(self):
""" Returns list of registered objects in database
WARNING: This method is deprecated, and will not be working
for Odoo 14.0+
"""
if self._registered_objects is not None:
return self._registered_objects
Expand Down
Loading

0 comments on commit fb2ad21

Please sign in to comment.