Catalog Export

Bug #1232925 reported by Fontaine Laurent on 2013-09-29
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Prestashop OpenERP Connector
Undecided
Akretion Team

Bug Description

Rapports externes :
export resources article from demo
 Action sur :
Article
Resource Id :
16
 ID externe :
Action :
_transform_and_send_one_resource
 Date :
30/09/2013 00:07:45
Status :
Echecs
Message d'erreur
'NoneType' object has no attribute 'nodeType'
<type 'exceptions.AttributeError'>
Traceback (most recent call last): File "/usr/lib/pymodules/python2.7/openerp/addons/base_external_referentials/decorator.py", line 130, in wrapper response = func(self, import_cr, uid, external_session, resource, *args, **kwargs) File "/usr/lib/pymodules/python2.7/openerp/addons/prestashoperpconnect_catalog_manager/product.py", line 91, in _transform_and_send_one_resource return super(product_product, self)._transform_and_send_one_resource(*args, **kwargs) File "/usr/lib/pymodules/python2.7/openerp/addons/base_external_referentials/external_osv.py", line 1114, in _transform_and_send_one_resource return self.send_to_external(cr, uid, external_session, {resource_id : resource}, mapping, mapping_id, update_date, context=context) File "/usr/lib/pymodules/python2.7/openerp/addons/prestashoperpconnect_catalog_manager/product.py", line 151, in send_to_external mapping, mapping_id, update_date=update_date, context=context) File "/usr/lib/pymodules/python2.7/openerp/addons/base_external_referentials/external_osv.py", line 998, in send_to_external ext_create_ids = self.ext_create(cr, uid, external_session, resources_to_create, mapping, mapping_id, context=context) File "/usr/lib/pymodules/python2.7/openerp/addons/base_external_referentials/decorator.py", line 49, in wrapped return func(self, cr, uid, argument, *args, **kwargs) File "/usr/lib/pymodules/python2.7/openerp/addons/prestashoperpconnect/prestashop_osv.py", line 106, in ext_create return self.ext_create_or_update(cr, uid, external_session, resources, 'add', mapping=mapping, mapping_id=mapping_id, context=context) File "/usr/lib/pymodules/python2.7/openerp/addons/prestashoperpconnect/prestashop_osv.py", line 99, in ext_create_or_update res[resource_id] = self.call_prestashop_method(cr, uid, external_session, resource_id, resource, method, mapping=mapping, mapping_id=mapping_id, context=context) File "/usr/lib/pymodules/python2.7/openerp/addons/prestashoperpconnect/prestashop_osv.py", line 84, in call_prestashop_method res = getattr(external_session.connection, ps_method)(mapping[mapping_id]['external_resource_name'], resource) File "/usr/local/lib/python2.7/dist-packages/prestapyt/prestapyt.py", line 247, in add return self.add_with_url(self._api_url + resource, content) File "/usr/local/lib/python2.7/dist-packages/prestapyt/prestapyt.py", line 444, in add_with_url xml_content = dict2xml.dict2xml({'prestashop': content}) File "/usr/local/lib/python2.7/dist-packages/prestapyt/dict2xml.py", line 118, 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'
Données externe
{"no_lang": {"ean13": false, "code": "demo_9", "categ_ids": [], "incoming_qty": 0.0, "standard_price": 200.0, "name_template": "tOUCH", "property_account_income": false, "seller_qty": 0.0, "attribute_set_id": false, "company_id": [1, "Your Company"], "loc_rack": false, "pricelist_id": [], "price_margin": 1.0, "property_stock_account_input": false, "warehouse_id": [], "outgoing_qty": 0.0, "variants": false, "partner_ref": "[demo_9] tOUCH", "rental": false, "mes_type": "fixed", "seller_id": false, "seller_ids": [], "attribute_custom_tmpl": {}, "supply_method": "buy", "orderpoint_ids": [], "weight": 0.0, "x_pm_basedon_list_price": "manual", "virtual_available": 0.0, "product_link_ids": [], "product_tmpl_id": [16, "tOUCH"], "image_ids": [], "state": false, "x_pm_inc_price_list_price": 345.64, "attribute_custom_variant": {}, "price": 289.0, "manufacturer_pname": false, "active": true, "loc_row": false, "manufacturer": false, "loc_case": false, "tax_group_id": false, "lst_price": 289.0, "x_shop2_attr_active": true, "warranty": 0.0, "property_stock_procurement": [6, "Emplacements Virtuels / Approvisionnements"], "uos_id": false, "list_price": 289.0, "color": 0, "packaging": [], "qty_available": 0.0, "uos_coeff": 1.0, "seller_delay": 1, "purchase_ok": true, "product_manager": false, "type": "consu", "track_incoming": false, "property_stock_production": [7, "Emplacements Virtuels / Production"], "supplier_taxes_id": [34], "volume": 0.0, "seller_info_id": false, "procure_method": "make_to_stock", "property_stock_inventory": [5, "Emplacements Virtuels / Pertes d'inventaire"], "cost_method": "standard", "valuation": "manual_periodic", "sale_delay": 7.0, "x_pm_product_coef_list_price": 1.445, "x_shop2_attr_online_only": false, "product_image": false, "property_stock_account_output": false, "product_brand_id": false, "manufacturer_pref": false, "track_production": false, "sale_ok": true, "price_extra": 0.0, "uom_id": [1, "PCE"], "default_code": "demo_9", "attribute_ids": [], "location_id": [], "id": 16, "track_outgoing": false, "uom_po_id": [1, "PCE"], "weight_net": 0.0, "supplier_goodies_ids": [], "categ_id": [8, "Root / Accueil / Test"], "x_shop2_attr_available_for_order": true, "x_shop2_attr_show_price": true, "produce_delay": 1.0, "property_account_expense": false, "taxes_id": [1]}, "en_US": {"x_shop2_attr_name": false, "description": "<h1>Titre 1</h1>\n<h2>Titre 2</h2>\n<h3>Titre 3</h3>\n<h4>Titre 4</h4>\n<h5>Titre 5</h5>\n<h6>Titre 6</h6>\n<ul>\n<li>UL</li>\n<li>UL</li>\n<li>UL</li>\n<li>UL</li>\n</ul>\n<ol>\n<li>OL</li>\n<li>OL</li>\n<li>OL</li>\n<li>OL</li>\n</ol>\n<p>paragraphe...</p>\n<p>paragraphe...</p>\n<p>paragraphe...</p>\n<table border=\"0\">\n<thead> \n<tr>\n<th>th</th> <th>th</th> <th>th</th>\n</tr>\n</thead> \n<tbody>\n<tr>\n<td>td</td>\n<td>td</td>\n<td>td</td>\n</tr>\n<tr>\n<td>td</td>\n<td>td</td>\n<td>td</td>\n</tr>\n</tbody>\n</table>\n<h3>Cinq nouvelles applications sous la main</h3>\n<p>Consultez vos e-mails au format HTML enrichi, avec photos et pieces jointes au format PDF, Word et Excel. Obtenez des cartes, des itin\u00e9raires et des informations sur l'\u00e9tat de la circulation en temps r\u00e9el. R\u00e9digez des notes et consultez les cours de la Bourse et les bulletins m\u00e9t\u00e9o.</p>\n<h3>Touchez du doigt votre musique et vos vid\u00e9os. Entre autres.</h3>\n<p>La technologie multi-touch r\u00e9volutionnaire int\u00e9gr\u00e9e au superbe \u00e9cran de 3,5 pouces vous permet d'effectuer des zooms avant et arri\u00e8re, de faire d\u00e9filer et de feuilleter des pages \u00e0 l'aide de vos seuls doigts.</p>\n<h3>Internet dans votre poche</h3>\n<p>Avec le navigateur Safari, vous pouvez consulter des sites web dans leur mise en page d'origine et effectuer un zoom avant et arri\u00e8re d'une simple pression sur l'\u00e9cran.</p>\n<h3>Contenu du coffret</h3>\n<ul>\n<li><span></span>iPod touch</li>\n<li><span></span>\u00c9couteurs</li>\n<li><span></span>C\u00e2ble USB 2.0</li>\n<li><span></span>Adaptateur Dock</li>\n<li><span></span>Chiffon de nettoyage</li>\n<li><span></span>Support</li>\n<li><span></span>Guide de d\u00e9marrage rapide</li>\n</ul>\n<p>\u00a0</p>", "x_shop2_attr_meta_keywords": false, "x_shop2_attr_link_rewrite": false, "x_shop2_attr_meta_description": false, "description_purchase": false, "x_shop2_attr_meta_title": false, "x_shop2_attr_short_description": false, "x_shop2_attr_tags": false, "x_shop2_attr_description": false, "description_sale": false, "id": 16, "name": "iPod touch (copy)"}, "fr_FR": {"x_shop2_attr_name": false, "description": "<h1>Titre 1</h1>\n<h2>Titre 2</h2>\n<h3>Titre 3</h3>\n<h4>Titre 4</h4>\n<h5>Titre 5</h5>\n<h6>Titre 6</h6>\n<ul>\n<li>UL</li>\n<li>UL</li>\n<li>UL</li>\n<li>UL</li>\n</ul>\n<ol>\n<li>OL</li>\n<li>OL</li>\n<li>OL</li>\n<li>OL</li>\n</ol>\n<p>paragraphe...</p>\n<p>paragraphe...</p>\n<p>paragraphe...</p>\n<table border=\"0\">\n<thead> \n<tr>\n<th>th</th> <th>th</th> <th>th</th>\n</tr>\n</thead> \n<tbody>\n<tr>\n<td>td</td>\n<td>td</td>\n<td>td</td>\n</tr>\n<tr>\n<td>td</td>\n<td>td</td>\n<td>td</td>\n</tr>\n</tbody>\n</table>\n<h3>Cinq nouvelles applications sous la main</h3>\n<p>Consultez vos e-mails au format HTML enrichi, avec photos et pieces jointes au format PDF, Word et Excel. Obtenez des cartes, des itin\u00e9raires et des informations sur l'\u00e9tat de la circulation en temps r\u00e9el. R\u00e9digez des notes et consultez les cours de la Bourse et les bulletins m\u00e9t\u00e9o.</p>\n<h3>Touchez du doigt votre musique et vos vid\u00e9os. Entre autres.</h3>\n<p>La technologie multi-touch r\u00e9volutionnaire int\u00e9gr\u00e9e au superbe \u00e9cran de 3,5 pouces vous permet d'effectuer des zooms avant et arri\u00e8re, de faire d\u00e9filer et de feuilleter des pages \u00e0 l'aide de vos seuls doigts.</p>\n<h3>Internet dans votre poche</h3>\n<p>Avec le navigateur Safari, vous pouvez consulter des sites web dans leur mise en page d'origine et effectuer un zoom avant et arri\u00e8re d'une simple pression sur l'\u00e9cran.</p>\n<h3>Contenu du coffret</h3>\n<ul>\n<li><span></span>iPod touch</li>\n<li><span></span>\u00c9couteurs</li>\n<li><span></span>C\u00e2ble USB 2.0</li>\n<li><span></span>Adaptateur Dock</li>\n<li><span></span>Chiffon de nettoyage</li>\n<li><span></span>Support</li>\n<li><span></span>Guide de d\u00e9marrage rapide</li>\n</ul>\n<p>\u00a0</p>", "x_shop2_attr_meta_keywords": false, "x_shop2_attr_link_rewrite": false, "x_shop2_attr_meta_description": false, "description_purchase": false, "x_shop2_attr_meta_title": false, "x_shop2_attr_short_description": false, "x_shop2_attr_tags": false, "x_shop2_attr_description": false, "description_sale": false, "id": 16, "name": "tOUCH"}}
Args Data
[16, "2013-09-29 22:02:50.655116", {"6": {"alternative_keys": false, "model_id": [119, "Article"], "external_update_method": false, "prestashop_primary_key": "product", "template_id": [6, "product.product"], "external_delete_method": false, "external_search_method": false, "related_model_ids": [119, 118], "external_get_method": false, "external_resource_name": "products", "external_create_method": false, "external_done_method": false, "referential_id": [1, "demo"], "mapping_ids": [36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49], "mapping_lines": [{"datetime_format": false, "external_field": "active", "in_function": false, "name": "active", "sequence": 10, "evaluation_type": "direct", "out_function": false, "field_id": [879, "Active"], "alternative_key": false, "child_mapping_id": false, "mapping_id": [6, "product.product"], "external_type": "int", "internal_type": "boolean", "internal_field": "active", "referential_id": [1, "demo"], "function_name": "Active", "selected": false, "type": "in_out", "id": 36, "template_id": [26, "active"], "related_model_id": [119, "Article"]}, {"datetime_format": false, "external_field": "available_for_sale", "in_function": false, "name": "available_for_sale", "sequence": 10, "evaluation_type": "direct", "out_function": false, "field_id": [862, "Can be Sold"], "alternative_key": false, "child_mapping_id": false, "mapping_id": [6, "product.product"], "external_type": "int", "internal_type": "boolean", "internal_field": "sale_ok", "referential_id": [1, "demo"], "function_name": "For sale", "selected": false, "type": "in_out", "id": 37, "template_id": [27, "available_for_sale"], "related_model_id": [119, "Article"]}, {"datetime_format": false, "external_field": "wholesale_price", "in_function": false, "name": "wholesale_price", "sequence": 10, "evaluation_type": "direct", "out_function": false, "field_id": [838, "Cost Price"], "alternative_key": false, "child_mapping_id": false, "mapping_id": [6, "product.product"], "external_type": "float", "internal_type": "float", "internal_field": "standard_price", "referential_id": [1, "demo"], "function_name": "Cost price", "selected": false, "type": "in_out", "id": 38, "template_id": [28, "wholesale_price"], "related_model_id": [119, "Article"]}, {"datetime_format": false, "external_field": "weight", "in_function": false, "name": "weight", "sequence": 10, "evaluation_type": "direct", "out_function": false, "field_id": [837, "Gross weight"], "alternative_key": false, "child_mapping_id": false, "mapping_id": [6, "product.product"], "external_type": "float", "internal_type": "float", "internal_field": "weight", "referential_id": [1, "demo"], "function_name": "Weight", "selected": false, "type": "in_out", "id": 39, "template_id": [29, "weight"], "related_model_id": [119, "Article"]}, {"datetime_format": false, "external_field": "name", "in_function": false, "name": "name", "sequence": 10, "evaluation_type": "direct", "out_function": false, "field_id": [848, "Name"], "alternative_key": false, "child_mapping_id": false, "mapping_id": [6, "product.product"], "external_type": "unicode", "internal_type": "char", "internal_field": "name", "referential_id": [1, "demo"], "function_name": "Name", "selected": false, "type": "in_out", "id": 40, "template_id": [30, "name"], "related_model_id": [119, "Article"]}, {"datetime_format": false, "external_field": "ean13", "in_function": "if resource.get('ean13'):\n if resource.get('ean13') == '0':\n oe_ean13 = False\n else:\n oe_ean13 = resource.get('ean13')\n result = [('ean13', oe_ean13)]", "name": "EAN 13", "sequence": 10, "evaluation_type": "function", "out_function": "if resource.get('ean13'):\n result = [('ean13', resource['ean13'])]", "field_id": [869, "EAN13"], "alternative_key": false, "child_mapping_id": false, "mapping_id": [6, "product.product"], "external_type": "unicode", "internal_type": "char", "internal_field": "ean13", "referential_id": [1, "demo"], "function_name": "EAN 13", "selected": false, "type": "in_out", "id": 41, "template_id": [31, "EAN 13"], "related_model_id": [119, "Article"]}, {"datetime_format": false, "external_field": "price", "in_function": false, "name": "price", "sequence": 10, "evaluation_type": "direct", "out_function": false, "field_id": [884, "Public Price"], "alternative_key": false, "child_mapping_id": false, "mapping_id": [6, "product.product"], "external_type": "float", "internal_type": "float", "internal_field": "lst_price", "referential_id": [1, "demo"], "function_name": "Sale price OUT", "selected": false, "type": "out", "id": 43, "template_id": [33, "price"], "related_model_id": [119, "Article"]}, {"datetime_format": false, "external_field": "reference", "in_function": false, "name": "reference", "sequence": 10, "evaluation_type": "direct", "out_function": false, "field_id": [877, "Reference"], "alternative_key": false, "child_mapping_id": false, "mapping_id": [6, "product.product"], "external_type": "unicode", "internal_type": "char", "internal_field": "default_code", "referential_id": [1, "demo"], "function_name": "Reference", "selected": false, "type": "in_out", "id": 44, "template_id": [34, "reference"], "related_model_id": [119, "Article"]}, {"datetime_format": false, "external_field": "description", "in_function": false, "name": "description", "sequence": 10, "evaluation_type": "direct", "out_function": false, "field_id": [853, "Description"], "alternative_key": false, "child_mapping_id": false, "mapping_id": [6, "product.product"], "external_type": "unicode", "internal_type": "text", "internal_field": "description", "referential_id": [1, "demo"], "function_name": "Description", "selected": false, "type": "in_out", "id": 45, "template_id": [35, "description"], "related_model_id": [119, "Article"]}, {"datetime_format": false, "external_field": "id_category_default", "in_function": false, "name": "id_category_default", "sequence": 10, "evaluation_type": "direct", "out_function": false, "field_id": [867, "Pricing/Primary Category"], "alternative_key": false, "child_mapping_id": false, "mapping_id": [6, "product.product"], "external_type": "int", "internal_type": "many2one", "internal_field": "categ_id", "referential_id": [1, "demo"], "function_name": "Main category", "selected": false, "type": "in_out", "id": 46, "template_id": [36, "id_category_default"], "related_model_id": [119, "Article"]}, {"datetime_format": false, "external_field": "categories", "in_function": "if 'categories' in resource:\n categ_ids = []\n for ext_categ_id in resource['categories']:\n if int(ext_categ_id) != int(resource['id_category_default']):\n categ_ids.append(self.pool.get('product.category').get_or_create_oeid(cr, uid, external_session, ext_categ_id, context=context))\n\n result = [('categ_ids', [(6, 0, categ_ids)])]", "name": "Product categories M2M", "sequence": 10, "evaluation_type": "function", "out_function": "if 'categ_ids' in resource:\n categ_ids_for_prestashop = []\n for categ_id in self._get_or_create_ext_category_ids_for_shop(cr, uid, external_session, resource['id'], context=context):\n categ_ids_for_prestashop.append({'id': categ_id})\n result = [('categories', {'category': categ_ids_for_prestashop})]", "field_id": [1036, "Product Categories"], "alternative_key": false, "child_mapping_id": false, "mapping_id": [6, "product.product"], "external_type": "unicode", "internal_type": "many2many", "internal_field": "categ_ids", "referential_id": [1, "demo"], "function_name": "Product categories M2M", "selected": false, "type": "in_out", "id": 47, "template_id": [37, "Product categories M2M"], "related_model_id": [119, "Article"]}, {"datetime_format": false, "external_field": "id_tax_rules_group", "in_function": false, "name": "id_tax_rules_group", "sequence": 10, "evaluation_type": "direct", "out_function": false, "field_id": [2757, "Tax Group"], "alternative_key": false, "child_mapping_id": false, "mapping_id": [6, "product.product"], "external_type": "int", "internal_type": "many2one", "internal_field": "tax_group_id", "referential_id": [1, "demo"], "function_name": "Product taxes", "selected": false, "type": "out", "id": 48, "template_id": [38, "id_tax_rules_group"], "related_model_id": [119, "Article"]}, {"datetime_format": false, "external_field": "accessories", "in_function": false, "name": "product_links", "sequence": 10, "evaluation_type": "function", "out_function": "if resource.get('product_link_ids'):\n linked_products = []\n links = self.pool.get('product.link').read(cr, uid, resource.get('product_link_ids'), ['type', 'linked_product_id'], context=context)\n for link in links:\n if link['type'] == 'cross_sell':\n linked_products.append({'id': self.pool.get('product.product').get_or_create_extid(cr, uid, external_session, link['linked_product_id'][0], context=context)})\n result = [('accessories', {'accessory': linked_products})]", "field_id": [2828, "Product links"], "alternative_key": false, "child_mapping_id": false, "mapping_id": [6, "product.product"], "external_type": "unicode", "internal_type": "one2many", "internal_field": "product_link_ids", "referential_id": [1, "demo"], "function_name": "product_links", "selected": false, "type": "out", "id": 49, "template_id": [124, "product_links"], "related_model_id": [119, "Article"]}], "key_for_external_id": "id", "model": "product.product", "external_list_method": false, "id": 6, "extra_name": false}}, 6]
Kwargs Data
{"defaults": null, "context": {"lang": "fr_FR", "tz": false, "uid": 1, "sale_shop_id": 2, "export_product": "simple", "pricelist": 1, "lang_to_export": ["fr_FR"], "report_id": 4}}

I send an copy of an imported article and i get this could you help me please ?
J'ai cette erreur lorsque que j'envoie un nouvelle article qui est pourtant la copie d'un article importer, pouvez vous m'aider ?

Ps it's an export of catalog ( Will work for category)
Ps Il s'agit d'un export Catalogue ( Qui fonction pour les catégorie)

Changed in prestashoperpconnect:
assignee: nobody → arthru (arthru)
Changed in prestashoperpconnect:
assignee: arthru (arthru) → nobody
assignee: nobody → Akretion Team (akretion-team)
assignee: Akretion Team (akretion-team) → Camptocamp (camptocamp)
assignee: Camptocamp (camptocamp) → Akretion Team (akretion-team)
Mathieu Stumpf (0s) on 2014-04-08
tags: added: export
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers