I'm triying to connect openerp 7 with magento 1.9, with php 5.5.15.
The pach for magento is applied in this version.
In the firts moment i can't sync the categories, by that i have changed the backend_adapter.py with the patch:
def _call(self, method, arguments):
try: custom_url = self.magento.use_custom_api_path
with magentolib.API(self.magento.location, self.magento.username, self.magento.password, full_url=custom_url) as api:
# If magento is used with PHP version >= 5.4, then we have to remove all
# trailing None values
if isinstance(arguments, list) and len(arguments) > 0 and arguments[-1] is None: arguments = [a for a in arguments if a is not None]
result = api.call(method, arguments)
Now I'm triying to import products, but I'm getting another error:
Traceback (most recent call last):
File "/opt/odoo/custom/addons/magento/openerp-connector7/connector/queue/worker.py", line 122, in run_job
job.perform(session)
File "/opt/odoo/custom/addons/magento/openerp-connector7/connector/queue/job.py", line 485, in perform
self.result = self.func(session, *self.args, **self.kwargs)
File "/opt/odoo/custom/addons/magento/openerp-connector-magento/magentoerpconnect/unit/import_synchronizer.py", line 369, in import_batch
importer.run(filters=filters)
File "/opt/odoo/custom/addons/magento/openerp-connector-magento/magentoerpconnect/product.py", line 258, in run
to_date=to_date)
File "/opt/odoo/custom/addons/magento/openerp-connector-magento/magentoerpconnect/product.py", line 213, in search
[filters] if filters else [{}])]
File "/opt/odoo/custom/addons/magento/openerp-connector-magento/magentoerpconnect/product.py", line 186, in _call
return super(ProductProductAdapter, self)._call(method, arguments)
File "/opt/odoo/custom/addons/magento/openerp-connector-magento/magentoerpconnect/unit/backend_adapter.py", line 166, in _call
File "/usr/local/lib/python2.7/dist-packages/magento/api.py", line 161, in call
return self.client.call(self.session, resource_path, arguments)
File "/usr/lib/python2.7/xmlrpclib.py", line 1224, in __call__
return self.__send(self.__name, args)
File "/usr/lib/python2.7/xmlrpclib.py", line 1578, in __request
verbose=self.__verbose
File "/usr/lib/python2.7/xmlrpclib.py", line 1264, in request
return self.single_request(host, handler, request_body, verbose)
File "/usr/lib/python2.7/xmlrpclib.py", line 1297, in single_request
return self.parse_response(response)
File "/usr/lib/python2.7/xmlrpclib.py", line 1467, in parse_response
p.feed(data)
File "/usr/lib/python2.7/xmlrpclib.py", line 557, in feed
self._parser.Parse(data, 0)
ExpatError: junk after document element: line 2, column 0
Whats the best option? Change the php version to 5.3 or 5.4 with applied patch, or is this error caused for other thing??
Hello Again.
I'm triying to connect openerp 7 with magento 1.9, with php 5.5.15.
The pach for magento is applied in this version.
In the firts moment i can't sync the categories, by that i have changed the backend_adapter.py with the patch:
def _call(self, method, arguments):
custom_ url = self.magento. use_custom_ api_path API(self. magento. location,
self. magento. username,
self. magento. password,
full_ url=custom_ url) as api:
try:
with magentolib.
# If magento is used with PHP version >= 5.4, then we have to remove all
# trailing None values
if isinstance( arguments, list) and len(arguments) > 0 and arguments[-1] is None:
arguments = [a for a in arguments if a is not None]
Now I'm triying to import products, but I'm getting another error:
Traceback (most recent call last): custom/ addons/ magento/ openerp- connector7/ connector/ queue/worker. py", line 122, in run_job perform( session) custom/ addons/ magento/ openerp- connector7/ connector/ queue/job. py", line 485, in perform custom/ addons/ magento/ openerp- connector- magento/ magentoerpconne ct/unit/ import_ synchronizer. py", line 369, in import_batch run(filters= filters) custom/ addons/ magento/ openerp- connector- magento/ magentoerpconne ct/product. py", line 258, in run date=to_ date) custom/ addons/ magento/ openerp- connector- magento/ magentoerpconne ct/product. py", line 213, in search custom/ addons/ magento/ openerp- connector- magento/ magentoerpconne ct/product. py", line 186, in _call oductAdapter, self)._call(method, arguments) custom/ addons/ magento/ openerp- connector- magento/ magentoerpconne ct/unit/ backend_ adapter. py", line 166, in _call
File "/opt/odoo/
job.
File "/opt/odoo/
self.result = self.func(session, *self.args, **self.kwargs)
File "/opt/odoo/
importer.
File "/opt/odoo/
to_
File "/opt/odoo/
[filters] if filters else [{}])]
File "/opt/odoo/
return super(ProductPr
File "/opt/odoo/
File "/usr/local/ lib/python2. 7/dist- packages/ magento/ api.py" , line 161, in call call(self. session, resource_path, arguments) python2. 7/xmlrpclib. py", line 1224, in __call__ send(self. __name, args) python2. 7/xmlrpclib. py", line 1578, in __request self.__ verbose python2. 7/xmlrpclib. py", line 1264, in request request( host, handler, request_body, verbose) python2. 7/xmlrpclib. py", line 1297, in single_request response( response) python2. 7/xmlrpclib. py", line 1467, in parse_response python2. 7/xmlrpclib. py", line 557, in feed _parser. Parse(data, 0)
return self.client.
File "/usr/lib/
return self.__
File "/usr/lib/
verbose=
File "/usr/lib/
return self.single_
File "/usr/lib/
return self.parse_
File "/usr/lib/
p.feed(data)
File "/usr/lib/
self.
ExpatError: junk after document element: line 2, column 0
Whats the best option? Change the php version to 5.3 or 5.4 with applied patch, or is this error caused for other thing??
Thanks to much