crash when synchronizing customers
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenERP Connector - Magento |
New
|
Undecided
|
Unassigned |
Bug Description
Hello,
I've faced the following crash when attempting an initial sync of partners from a Magento 1.7.0.0 site, with python magento-0.4 and the connector in version 2.3.1:
File "/srv/openerp/
job.
File "/srv/openerp/
self.result = self.func(session, *self.args, **self.kwargs)
File "/srv/openerp/
importer.
File "/srv/openerp/
self.
File "/srv/openerp/
if binder.
KeyError: 'group_id'
Some instrumenting of the code showed that the call made to magento to get the partner information is:
with magento.API(url, user, passwd) as api:
p = api.call(
which means the attributes argument is None. In that case, the magento server returns the bare minimum fields:
{'customer_id': '28337', 'updated_at': '2014-02-03 10:41:46', 'increment_id': None}
which causes the crash later on.
If I use a call such as
with magento.
p = customer_
then I get a much nicer set of keys in the dictionary, including the group_id key.
Reading the code of the python magento module, I tested:
with magento.API(url, user, passwd) as api:
p = api.call(
and this gives the expected result.
So I think the GenericAdapter.read method should be updated to not pass the attributes arguement if it is None.
Related branches
- Romain Deheele - Camptocamp (community): Approve (code review)
- Guewen Baconnier @ Camptocamp: Approve
-
Diff: 17 lines (+5/-1)1 file modifiedmagentoerpconnect/unit/backend_adapter.py (+5/-1)
description: | updated |
Probably a duplicate of lp:1210775
Magento is supported on PHP versions 5.2.13 - 5.3.24. A patch has been published on the Magento's website for the version 5.4: http:// magento. com/blog/ magento- news/magento- now-supports- php-54# .Uud_3bQweUk