- Fix regression with SSL support for XML-RPC. Still, it is recommended to use JSON-RPC, because it is more reliable.
- Added auto tests for Odoo 15.0 and python 3.10
- 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.
- Support for timeout in connections
- Changed license to MPL 2.0
- Removed old alias *odoo_rpc_client.orm.record.RecordRelations
- Added search_count method to objects (models)
- Added create_record method to objects (models)
- Added tests for Odoo 11
- Added overloads of operators (+, +=) for recordlists
- Removed local database connector, because it is difficult to test it, and it is not used so often as xml-rpc and json-rpc connectors May be in future it will have it's own python package.
- Avoid unneccesary encode/decode in db dump/restore logic
- Use simplejson for jsonrpc
- Odoo 10 local connector: correcly close db connections on exit
- Fix local connector for odoo-9.0 when odoo.py is on python path
Split openerp_proxy project to set of smaler project to avoid bringing lot of unneccessary dependencies.
This project contains core features, aiming to minimize dependencies.
Features, not included here, all this features will be still available in openerp_proxy project, which will depend on this one in future:
- Extensions (especialy repr extension)
- Sessions
- Shell
- Experimental code (introduced in openerp_proxy 0.7.0)
- Plugin - Diagraming
- New features added:
- Connector: 'local'. It allows to connect to local odoo instalce,
- without http;
- Bugfix in
Client.ref
method. now it returnsRecord
instance, as mentioned in documentation - Added
Record.get(field_name, default)
method.
client.server_version
now is aliase toclient.services.db.server_base_version
- Added
services.db.server_base_version()
which could be safely compared like:client.services.db.server_base_version() >= pkg_resources.parse_version('9.0')
- Added method
search_read
to orm.object - Drop support of OpenERP 6.0
ext.repr
: Added ability to pass table format to .as_table method tablefmt arg must be suitable for tabulate.tabulate method from Tabulate package- Added
openerp_proxy.experimental
subpackage. - Refactored session logic. Logic related to database / client connection
management moved to separate class
openerp_proxy.session.ClientManager
which can be used outside session logic. - Added
Client.ref
method, then returnsRecord
instance for specified xmlid - Added
Client.database_version_full
andClient.database_version
properties - Added
Session.del_db
andClientManager.del_client
methods - Added
client.services.db.db_exist
method wrapper
external_ids
plugin now addsRecord.as_xmlid
method- bugfix: ensure thet record is present in cache on init of Record class
- bugfix: [json-rpc], if RPC method results in None, then there is no 'result' object in response, so if there are no 'error' object, nor 'result', then suppose that 'result' is None, thus it is possible to deal with Odoo methods, that returns None as result via RPC
- bugfix in
HTMLTable.to_csv
for Python 3 related to writing non-ascii characters to csv file - Link to new example added to readme
- session added property
index_rev
, which is used to save index in file - bugfix in
utils.AttrDict.__dir__
method. now it works, so IPython auto-comlete for objects that useutils.AttrDict
class works too - better support of last IPython shell
- prefetching:
- bugfix: some times when passed few fields with same names, prefetch raises strange errors (atleast on odoo 7.0 instance)
- improvement: prefetch only records that have no at least one field in cache
- Representation module improvements
- HField: added
is_header
parameter, which in HTML representation wraps field in<th>
tag instead of default<td>
orm.Record
representation improvement: now it is displayed as three-column table with system field name, user visible field name and field value
- HField: added
- Examples:
- Added one more example: RecordList Representation.ipynb
- Bugfixes:
- session: client._no_save attr was not set on client by default
- session: connection index now saved in session too
- representation: better handled cases when HField._field is callable which throws error, now, if field._silent is set, then no error will be raised
- representation: if HField which results in HTML capable value, displayed not inside HTMLTable, then default value representation will be used, not HTML one.
Bugfix: Issue #4
Bugfix: double call to _get_registered_objects, caused be cleaning caches, on assess to any service first time
module_utils plugin fixes mostly related to __dir__ method (used for auto-complete in IPython)
- added
stdcall
decorators toupgrade
andinstall
methods of 'ir.module.module' object - Bugfix in
__dir__
implementation for plugin object - added
installed_modules
property tomodule_utils
plugin - better tests for this plugin
- added
- Added
openerp_proxy.plugins.external_ids
plugin openerp_proxy.ext.repr
: better support ofIPython.display.HTML
objects representationopenerp_proxy.ext.sugar
: Added ability to access plugins directly fromclient
instance For example, instead of writingclient.plugins.Test
, you may writeclient.Test
stdcall
decorator andstdcall
-methods. All methods oform.object.Object
instances, decorated with this decorator will be visible as methods oform.record.Record
andorm.record.RecordList
instances, which means that these methods could be called inmeth([ids], *, context=context, **)
format. All automaticaly generated proxy method are marked asstdcall
This is implemented to be able to usedir
-based auto-completition for such method forRecord
andRecordList
instancesopenerp_proxy.plugin.Plugins
,openerp_proxy.plugin.PluginManager
,openerp_proxy.service.service.ServiceManager
,openepr_proxy.service.service.ServiceBase
representation improvements (better__str__
and__repr__
overrides)- Bugfix. Automaticaly clean service caches when new service class is defined
- Added
__contains__
override formodule_utils
plugin. Thus it is posible to check if some addon is available on odoo easier:'project_sla' in client.plugins.module_utils
or'project_sla' in client.module_utils
- Improved documentation
- Added
Client.user_context
property - Bugfix in
openerp_proxy.ext.repr
with nested tables when, field is a function - Fix for PR #3
- Documentation improvements
- Added
Record.copy()
method override. - HTML representation fixes and improvements
- experimental Added integration with AnyField
- Added
RecordList.mapped
method, similar to Odoo'sRecordSet.mapped
method. - Partial fix related to changes in Odoo versioning. See Issue #9799
- To
module_utils
plugin addedupdate_module_list
method. - A bit of renaming (usualy used internaly)
(may affect custom plugins and extensions)
Property
proxy
, which points to relatedClient
instance, was renamed toclient
- Added
tabulate
integration. Now when app is running under IPython shell, it is posible to printRecordList
, and singleRecord
as normal readable tables. Thanks to Tabulate project - Added ability to extend Record of specific models. This allows records of diferent models (objects) to behave specificaly This may be used for example to add virtual fields in client sripts
- Little refactored connection system. Bugs with connection via SSL (https) seems to be fixed. As for JSON-RPC, there are some errors may be thrown, telling that program cannot verify certificate. as workaround You may pass to Client constructor kayword argument ssl_verify=False
log_execute_console
AddedTimeTracker
context manager, which can be used for performance testing. It makes posible to get total time code was running, and how much time was spent on RPC requests.
- DB service little bit refactored. added methods:
- dump_db: wrapper around
db.dump
server method. - restore_db: wrapper around
db.restore
server methods.
- dump_db: wrapper around
openerp_proxy.ext.repr.HField
addedF()
method, which allows to create child field instanceopenerp_proxy.ext.repr
improved styles for HTML representations
Backward incompatible: Changed session file format. Start up imports and extra_paths moved to options section of file.
Backward incompatible:
IPYSession
moved toopenerp_proxy.ext.repr
extensions. Now when using IPython notebook, this extension have to be imported first, to enable HTML representation of session object.Backward incompatible: Changed signature of
Session.connect()
method.Backward incompatible: Renamed
ERP_Proxy
toClient
and inherited objects renamed in such way (for example sugar extension module)Backward incompatible: removed
ERP_Proxy` and ``ERP_Session
compatability aliasesBackward incompatible: rename
openerp_proxy.service.service.ServiceManager.list
toopenerp_proxy.service.service.ServiceManager.service_list
. This affectsClient.services
so nowClient.services.service_list
should be used instead of usingClient.services.list
Backward incompatible: reports service refactored.
wrap_result
parametr to report service method removed. instead addedgenerate_report
method, which is recommended to use.Added new way reports could be generated in
client.services.report[report_name].generate(report_data)
wherereport_data
could be one of:- Record instance
- RecordList instance
- tuple('model.name', model_ids))
Added HTML representation for report service objects
Changed
store_passwords
option meaning. now if set it will store passwords bese64 encoded, instead of using simple-crypt module. This change makes it faster to decode password, because last-versions of simple-crypt become too slow, and usualy no encryption needed here.Experimental Python 3.3+ support
Added
HField.with_args
method.Added basic implementation of graph plugin.
Improved
openerp_proxy.ext.log_execute_console
extension. Added timing.Added
Client.clean_caches()
method, which is used to clean cache of registered modelsRecordList prefetching logic moved to cache module and highly refactored (Added support of prefetching of related fields)
Added
Client.login(dbname, user, password)
method.Added
HTMLTable.update
method.Added
RecordList.copy()
andRecordList.existing()
methods.Added
HTMLTable.to_csv()
method.Added
Client.server_version
propertyClient parametrs (dbname, user, pwd) now are not required. This is useful when working with
db
service (client.services.db
)
Added
RecordList.prefetch
method. Als RecordList's fields argument now works.Changed
Object
class. Now it haveextend_me.ExtensibleByHashType
metaclass which allows it to be extended separatly for each model, and in general way. For example look atopenerp_proxy.plugins.module_utils
module.Refactored
openerp_proxy.core
module. + better docstringsopenerp_proxy.ext.data
RecordList.prefetch
is disabled at the moment. Will be integrated in code, or atleast reimplemented in different way- Better
RecordList.group_by
method. Now it colud receive callable which should calculate key for records to group them by - Added
RecordList.filter
method. Useful when You want to filter records by functional field.
Added
openerp_proxy.ext.log_execute_console
extension- HTML representation for IPython notebook extension
openerp_proxy.ext.repr
- Added HTML representation of
- Record
- Record.as_table (user is able to specify fields of record to display)
- RecordList
- RecordList.as_html_table (display records contained by list as table with abilities to highlight them by condition callables and to specify fields to be displayed)
- Object.columns_info now displayed as HTML table.
- Also context help in HTML representation present
- HTML representation for IPython notebook extension
Partial context passing support in ORM
openerp_proxy.orm.record
refactored greatlyIn this version added support of "query cache", like that one present in odoo's browse_record class (version 7.0). It is dict with data shared by records in one query. thus no need to read each record separatly, nor need to read all fields records in current query at one time. But major optimization which is not implemented yet is implementation of some prefetching mechanism, to allow user to specify what fields for what model he would like to read, to reduce RPC calls.
Record class little bit optimized with slots, but still takes a lot of memory, because of extensibility.
Added
Record.read
method, which, performs read on record, store data been read to record, and returns dict with data been readRecordList.sort
method was added. implements in-place sort like in usual lists.RecordList.search
andRecordList.search_records
methods were implemented. The difference from standard is that these methods will automaticaly add [('id','in',self.ids)] to search domainObject
class: added properties:model_name
: return name of object's modelmodel
: returnsRecord
instance for model of this object
Added
module_utils
plugin, as example and as utility to work with modules via RPC- Report service wrapper (
openerp_proxy.service.report
) refactored. - Simplified RPC methods signatures.
- Added wrapper on report result which can automaticaly decode and save report result
- Report service wrapper (
Added basic options support for sessions. But in future this should be reimplemented as normal config At this moment there only one option
store_passwords
which enables session to store encrypted passwords in session Note that encryption is very low. To make this option work You should install simple-crypt.ERP_Session
renamed toSession
but for backward compatability, there isERP_Session
name still present in module.Added
IPYSession
class. At this moment there is only one difference from standardSession
class: presense of_repr_html_
method.
- Record objects now behaves more like browse_record in OpenERP. No more need in suffix '__obj' to get related fields as records. They will be automaticaly converted to Record objects.
- __getattribute___ in most cases changed to __getattr__
- Record._name property that returns result of name_get method for this record
- Objec.columns_info refactored to use fields_get method to get list of fields for an object
- Plugin system refactored. Not it is class-based.
- Added extension system, which allow to extend most of classe. For example see 'openerp_proxy.ext' dir/package where placed some set of extensions
- All orm-related logic facored out into separate package openerp_proxy.orm
- session's database's aliases: to easily get some database in futuer, You could give it alias name
- Now it is posible to enable automatic conversion of date/time field value to datetime objects. Implemented via extension
- Sugar extension: less typing)