/!Backwards incompatible changes inside.
Add openerp.api.Environment
in Session
It is accessible in self.env
in Session
and all
ConnectorUnit
instances.
Also in ConnectorUnit
, model
returns the current (new api!) model:
# On the current model
self.model.search([])
self.model.browse(ids)
# on another model
self.env['res.users'].search([])
self.env['res.users'].browse(ids)
Deprecate the CRUD methods in Session
# NO
self.session.search('res.partner', [])
self.session.browse('res.partner', ids)
# YES
self.env['res.partner'].search([])
self.env['res.partner'].browse(ids)
Environment.set_lang()
is removed. It was modifying the context
in place which is not possible with the new frozendict context. It
should be done with:
with self.session.change_context(lang=lang_code):
...
Add an argument on the Binders methods to return a browse record
binder.to_openerp(magento_id, browse=True)
Shorten ConnectorUnit.get_binder_for_model
to
ConnectorUnit.binder_for
Shorten ConnectorUnit.get_connector_unit_for_model
to
ConnectorUnit.unit_for
Renamed Environment
to ConnectorEnvironment
to avoid
confusion with openerp.api.Environment
Renamed the class attribute ConnectorUnit.model_name
to
ConnectorUnit.for_model_name
.
Added _base_binder
, _base_mapper
, _base_backend_adapter
in
the synchronizers (Importer, Exporter) so it is no longer required to
override the binder
, mapper
, backend_adapter
property
methods
Session.change_context()
now supports the same
argument/keyword arguments semantics than
openerp.model.BaseModel.with_context()
.
Renamed ExportSynchronizer
to Exporter
Renamed ImportSynchronizer
to Importer
Renamed DeleteSynchronizer
to Deleter
Session.commit
do not commit when tests are running
Cleaned the methods that have been deprecated in version 2.x