~isaac.delabarrera/prestashoperpconnect/update_product_category

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
id,sequence,type,evaluation_type,external_field,field_id:id,external_type,alternative_key,mapping_id:id,function_name,in_function,out_function,child_mapping_id:id,datetime_format
prestashoperpconnect.prestashop_1400_product_category_position,0,in_out,direct,position,product.field_product_category_sequence,int,False,prestashoperpconnect.prestashop_1400_product_categ,,,,,
prestashoperpconnect.prestashop_1400_product_category_name,0,in_out,direct,name,product.field_product_category_name,unicode,False,prestashoperpconnect.prestashop_1400_product_categ,,,,,
prestashop1400_product_category_link_rewrite,0,out,function,link_rewrite,product.field_product_category_complete_name,unicode,False,prestashoperpconnect.prestashop_1400_product_categ,link_rewrite,,"result = [('link_rewrite', (resource.get('name').lower()).replace(' ', '_' ))]",,
prestashop1400_product_category_active,0,in_out,function,active,,unicode,False,prestashoperpconnect.prestashop_1400_product_categ,active,"result=[('active',1)]","result=[('active',1)]",,
prestashop1400_product_category_nright,0,in_out,direct,nright,product.field_product_category_parent_right,int,False,prestashoperpconnect.prestashop_1400_product_categ,,,,,
prestashop1400_product_category_nleft,0,in_out,direct,nleft,product.field_product_category_parent_left,int,False,prestashoperpconnect.prestashop_1400_product_categ,,,,,
prestashop1400_product_category_level_depth,0,in_out,direct,level_depth,gst_prestashop.field_product_category_level,int,False,prestashoperpconnect.prestashop_1400_product_categ,,,,,
prestashoperpconnect.prestashop_1400_product_category_parent_id,0,in_out,function,id_parent,product.field_product_category_parent_id,int,False,prestashoperpconnect.prestashop_1400_product_categ,id_parent,"if resource.get('id_parent') and resource.get('id_parent') != '0':
    parent_id = self.extid_to_oeid(cr,uid,  external_session, int(resource.get('id_parent')))
    result = [('parent_id', parent_id)]
else:
    result = [('parent_id', None)]","if resource.get('parent_id'):
    parent_id = self.oeid_to_extid(cr,uid,  external_session, resource.get('parent_id')[0])
    result = [('id_parent', str(parent_id))]
else:
    result = [('id_parent', '')]",,