[7.0] export product error

Bug #1281461 reported by Omar
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Prestashop OpenERP Connector
New
Undecided
Unassigned

Bug Description

When i try to export to prestashop a new product i got this error:

 openerp.addons.connector.queue.worker: Traceback (most recent call last):
  File "/home/openerp/lp/openerp-connector/connector/queue/worker.py", line 122, in run_job
    job.perform(session)
  File "/home/openerp/lp/openerp-connector/connector/queue/job.py", line 460, in perform
    self.result = self.func(session, *self.args, **self.kwargs)
  File "/home/openerp/lp/prestashoperpconnect/prestashoperpconnect/unit/export_synchronizer.py", line 205, in export_record
    return exporter.run(binding_id, fields=fields)
  File "/home/openerp/lp/prestashoperpconnect/prestashoperpconnect/unit/export_synchronizer.py", line 79, in run
    result = self._run(*args, **kwargs)
  File "/home/openerp/lp/prestashoperpconnect/prestashoperpconnect/unit/export_synchronizer.py", line 160, in _run
    self.prestashop_id = self._create(record)
  File "/home/openerp/lp/prestashoperpconnect/prestashoperpconnect/unit/export_synchronizer.py", line 124, in _create
    return self.backend_adapter.create(data)
  File "/home/openerp/lp/prestashoperpconnect/prestashoperpconnect/unit/backend_adapter.py", line 154, in create
    self._export_node_name: attributes
  File "/usr/local/lib/python2.7/dist-packages/prestapyt/prestapyt.py", line 267, in add
    return self.add_with_url(self._api_url + resource, content, files)
  File "/usr/local/lib/python2.7/dist-packages/prestapyt/prestapyt.py", line 503, in add_with_url
    xml_content = dict2xml.dict2xml({'prestashop': content})
  File "/usr/local/lib/python2.7/dist-packages/prestapyt/dict2xml.py", line 119, in dict2xml
    root, _ = _process_complex(doc, data.items())
  File "/usr/local/lib/python2.7/dist-packages/prestapyt/dict2xml.py", line 71, in _process_complex
    nodes = _process(doc, tag, value)
  File "/usr/local/lib/python2.7/dist-packages/prestapyt/dict2xml.py", line 49, in _process
    nodelist, attrs = _process_complex(doc, tag_value.items())
  File "/usr/local/lib/python2.7/dist-packages/prestapyt/dict2xml.py", line 71, in _process_complex
    nodes = _process(doc, tag, value)
  File "/usr/local/lib/python2.7/dist-packages/prestapyt/dict2xml.py", line 51, in _process
    node.appendChild(child)
  File "/usr/lib/python2.7/xml/dom/minidom.py", line 112, in appendChild
    if node.nodeType == self.DOCUMENT_FRAGMENT_NODE:
AttributeError: 'NoneType' object has no attribute 'nodeType'

and no export is done.

thank you
Omar

Tags: 7.0 export
Omar (o-dini77)
summary: - [7.0] export produxt error
+ [7.0] export product error
Omar (o-dini77)
tags: added: 7.0 export
Revision history for this message
atchuthan (atchuthantu) wrote :

Omar, I had the same problem with the older version of Prestapyt library.

There was no support for float field type(cost and selling price of product) in the Prestapyt library .

The github version of Prestapyt for dict2xml.py contains
    # Create a new node for simple values
    if isinstance(tag_value, int) or isinstance(tag_value, (str, unicode)):
        return _process_simple(doc, tag, tag_value)

and in Launchpad (https://code.launchpad.net/~akretion-team/prestashoperpconnect/akretion-prestapyt)
    # Create a new node for simple values
    if isinstance(tag_value, (int, float)) or isinstance(tag_value, (str, unicode)):
        return _process_simple(doc, tag, tag_value)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.