Comment 2 for bug 1306010

Revision history for this message
David (dhecar) wrote :

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):
        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??

Thanks to much