<commit_before>"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"
"mag1500_product_product_price_out",,"out","direct","price","product.field_product_product_price","float","False","magentoerpconnect.mag1500_product_product",,,,,
"magentoerpconnect.mag1500_product_product_minimal_price",,"in_out","function","minimal_price",,"float","False","magentoerpconnect.mag1500_product_product","x_magerp_minimal_price","result = [('x_magerp_minimal_price',ifield)]","
if 'x_magerp_minimal_price' in resource:
    if resource['x_magerp_minimal_price'] and resource['x_magerp_minimal_price'] != 0:
        result = [('minimal_price',resource['x_magerp_minimal_price'])]
    else:
        result = [('minimal_price',False)]",,
"magentoerpconnect.mag1500_product_product_weight",,"in_out","direct","weight","product.field_product_template_weight","float","False","magentoerpconnect.mag1500_product_product",,,,,
"magentoerpconnect.mag1500_product_product_type_id",,"in_out","function","type_id","magentoerpconnect.field_product_product_product_type","unicode","False","magentoerpconnect.mag1500_product_product","product_type","if ifield:
    product_type_ids  = self.pool.get('magerp.product_product_type').search(cr,uid,[('product_type','=',ifield)])
    if product_type_ids:
        result = [('product_type',ifield)]
if ifield == 'simple':
    result.append(('type', 'product'))","if 'product_type' in resource and resource['product_type']:
    result = [('type_id', resource['product_type'])]
else:
    result = [('type_id','simple')]",,
"magentoerpconnect.mag1500_product_product_price_in",,"in","direct","price","product.field_product_template_list_price","float","False","magentoerpconnect.mag1500_product_product",,,,,
"magentoerpconnect.mag1500_product_product_cost",,"in","direct","cost","product.field_product_template_standard_price","float","False","magentoerpconnect.mag1500_product_product",,,,,
"magentoerpconnect.mag1500_product_product_description",,"in_out","direct","description","product.field_product_template_description","unicode","False","magentoerpconnect.mag1500_product_product",,,,,
"magentoerpconnect.mag1500_product_product_name",,"in_out","direct","name","product.field_product_template_name","unicode","False","magentoerpconnect.mag1500_product_product",,,,,
"magentoerpconnect.mag1500_product_product_set",,"in_out","direct","set","magentoerpconnect.field_product_template_set","int","False","magentoerpconnect.mag1500_product_product",,,,,
"magentoerpconnect.mag1500_product_product_websites",,"in_out","function","websites","magentoerpconnect.field_product_template_websites_ids","list","False","magentoerpconnect.mag1500_product_product","websites","websites_ids = []
for ext_id in ifield:
    websites_ids.append(self.pool.get('external.shop.group').extid_to_oeid(cr, uid, external_session, ext_id, context=context))

##### OPTION START, with this if the field websites of the product is empty the product is exported on every website
all_oe_websites_ids = self.pool.get('external.shop.group').search(cr,uid,[('referential_id', '=', referential_id)])
if set(websites_ids) == set(all_oe_websites_ids):
    websites_ids =[]
##### OPTION END

result=[('websites_ids', [(6,0, websites_ids)])]","##### OPTION START, with this if the field websites of the product is empty the product is exported on every website
if 'websites_ids' in resource:
    if not resource['websites_ids']:
        resource['websites_ids'] = self.pool.get('external.shop.group').search(cr,uid,[('referential_id', '=', referential_id)])
    ##### OPTION END

    ext_websites_ids = []
    for oe_id in resource['websites_ids']:
        ext_websites_ids.append(self.pool.get('external.shop.group').oeid_to_existing_extid(cr, uid, referential_id, oe_id))

    result=[('websites', ext_websites_ids)]",,
"magentoerpconnect.mag1500_product_product_short_description",,"in_out","direct","short_description","product.field_product_template_description_sale","unicode","False","magentoerpconnect.mag1500_product_product",,,,,
"magentoerpconnect.mag1500_product_product_sku",,"in_out","direct","sku","product.field_product_product_default_code","unicode",1,"magentoerpconnect.mag1500_product_product",,,,,
"magentoerpconnect.mag1500_product_product_categories",,"in_out","function","categories","product.field_product_template_categ_id","list","False","magentoerpconnect.mag1500_product_product","categories","categ_ids =[]
if ifield:
    for category_id in ifield:
        categ_ids.append(self.pool.get('product.category').get_or_create_oeid(cr, uid, external_session, category_id, context=context))
    main_categ_id = categ_ids.pop()
else:
    main_categ_id = self.pool.get('external.referential').browse(cr, uid, referential_id).default_pro_cat.id
result = [('categ_id', main_categ_id), ('categ_ids',[(6, 0, categ_ids)])]","
cat_obj = self.pool.get('product.category')
categ_ids = [resource['categ_id'][0]] + resource.get('categ_ids', [])
mag_categ_ids = []
for categ_id in categ_ids:
    mag_categ_id = cat_obj.get_or_create_extid(cr, uid, external_session, categ_id, context=context)
    mag_categ_ids.append(mag_categ_id)
result=[('categories', categ_ids)]",,
"mag1500_product_product_special_price",,"in_out","function","special_price",,"float","False","magentoerpconnect.mag1500_product_product","special_price","if 'x_magerp_special_price' in resource: result = [('x_magerp_special_price', ifield)]","if 'x_magerp_special_price' in resource: 
    if resource['x_magerp_special_price']:
        result = [('special_price', resource['x_magerp_special_price'])]
    else:
        result = [('special_price', False)]",,
mag1500_product_product_product_link,,out,sub-mapping,product_link,product_links.field_product_product_product_link_ids,list,False,magentoerpconnect.mag1500_product_product,,,,magentoerpconnect.mag1500_product_link,<commit_msg>[FIX] fix category export<commit_after>"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"
"mag1500_product_product_price_out",,"out","direct","price","product.field_product_product_price","float","False","magentoerpconnect.mag1500_product_product",,,,,
"magentoerpconnect.mag1500_product_product_minimal_price",,"in_out","function","minimal_price",,"float","False","magentoerpconnect.mag1500_product_product","x_magerp_minimal_price","result = [('x_magerp_minimal_price',ifield)]","
if 'x_magerp_minimal_price' in resource:
    if resource['x_magerp_minimal_price'] and resource['x_magerp_minimal_price'] != 0:
        result = [('minimal_price',resource['x_magerp_minimal_price'])]
    else:
        result = [('minimal_price',False)]",,
"magentoerpconnect.mag1500_product_product_weight",,"in_out","direct","weight","product.field_product_template_weight","float","False","magentoerpconnect.mag1500_product_product",,,,,
"magentoerpconnect.mag1500_product_product_type_id",,"in_out","function","type_id","magentoerpconnect.field_product_product_product_type","unicode","False","magentoerpconnect.mag1500_product_product","product_type","if ifield:
    product_type_ids  = self.pool.get('magerp.product_product_type').search(cr,uid,[('product_type','=',ifield)])
    if product_type_ids:
        result = [('product_type',ifield)]
if ifield == 'simple':
    result.append(('type', 'product'))","if 'product_type' in resource and resource['product_type']:
    result = [('type_id', resource['product_type'])]
else:
    result = [('type_id','simple')]",,
"magentoerpconnect.mag1500_product_product_price_in",,"in","direct","price","product.field_product_template_list_price","float","False","magentoerpconnect.mag1500_product_product",,,,,
"magentoerpconnect.mag1500_product_product_cost",,"in","direct","cost","product.field_product_template_standard_price","float","False","magentoerpconnect.mag1500_product_product",,,,,
"magentoerpconnect.mag1500_product_product_description",,"in_out","direct","description","product.field_product_template_description","unicode","False","magentoerpconnect.mag1500_product_product",,,,,
"magentoerpconnect.mag1500_product_product_name",,"in_out","direct","name","product.field_product_template_name","unicode","False","magentoerpconnect.mag1500_product_product",,,,,
"magentoerpconnect.mag1500_product_product_set",,"in_out","direct","set","magentoerpconnect.field_product_template_set","int","False","magentoerpconnect.mag1500_product_product",,,,,
"magentoerpconnect.mag1500_product_product_websites",,"in_out","function","websites","magentoerpconnect.field_product_template_websites_ids","list","False","magentoerpconnect.mag1500_product_product","websites","websites_ids = []
for ext_id in ifield:
    websites_ids.append(self.pool.get('external.shop.group').extid_to_oeid(cr, uid, external_session, ext_id, context=context))

##### OPTION START, with this if the field websites of the product is empty the product is exported on every website
all_oe_websites_ids = self.pool.get('external.shop.group').search(cr,uid,[('referential_id', '=', referential_id)])
if set(websites_ids) == set(all_oe_websites_ids):
    websites_ids =[]
##### OPTION END

result=[('websites_ids', [(6,0, websites_ids)])]","##### OPTION START, with this if the field websites of the product is empty the product is exported on every website
if 'websites_ids' in resource:
    if not resource['websites_ids']:
        resource['websites_ids'] = self.pool.get('external.shop.group').search(cr,uid,[('referential_id', '=', referential_id)])
    ##### OPTION END

    ext_websites_ids = []
    for oe_id in resource['websites_ids']:
        ext_websites_ids.append(self.pool.get('external.shop.group').oeid_to_existing_extid(cr, uid, referential_id, oe_id))

    result=[('websites', ext_websites_ids)]",,
"magentoerpconnect.mag1500_product_product_short_description",,"in_out","direct","short_description","product.field_product_template_description_sale","unicode","False","magentoerpconnect.mag1500_product_product",,,,,
"magentoerpconnect.mag1500_product_product_sku",,"in_out","direct","sku","product.field_product_product_default_code","unicode",1,"magentoerpconnect.mag1500_product_product",,,,,
"magentoerpconnect.mag1500_product_product_categories",,"in_out","function","categories","product.field_product_template_categ_id","list","False","magentoerpconnect.mag1500_product_product","categories","categ_ids =[]
if ifield:
    for category_id in ifield:
        categ_ids.append(self.pool.get('product.category').get_or_create_oeid(cr, uid, external_session, category_id, context=context))
    main_categ_id = categ_ids.pop()
else:
    main_categ_id = self.pool.get('external.referential').browse(cr, uid, referential_id).default_pro_cat.id
result = [('categ_id', main_categ_id), ('categ_ids',[(6, 0, categ_ids)])]","if 'categ_id' in resource:
    cat_obj = self.pool.get('product.category')
    categ_ids = [resource['categ_id'][0]] + resource.get('categ_ids', [])
    mag_categ_ids = []
    for categ_id in categ_ids:
        mag_categ_id = cat_obj.get_or_create_extid(cr, uid, external_session, categ_id, context=context)
        mag_categ_ids.append(mag_categ_id)
    result=[('categories', mag_categ_ids)]",,
"mag1500_product_product_special_price",,"in_out","function","special_price",,"float","False","magentoerpconnect.mag1500_product_product","special_price","if 'x_magerp_special_price' in resource: result = [('x_magerp_special_price', ifield)]","if 'x_magerp_special_price' in resource: 
    if resource['x_magerp_special_price']:
        result = [('special_price', resource['x_magerp_special_price'])]
    else:
        result = [('special_price', False)]",,
mag1500_product_product_product_link,,out,sub-mapping,product_link,product_links.field_product_product_product_link_ids,list,False,magentoerpconnect.mag1500_product_product,,,,magentoerpconnect.mag1500_product_link,
{'fraction_non_alphanumeric': 0.1614160172442381, 'fraction_numerical': 0.021721107610678164, 'mean_word_length': 11.246700507614213, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3636246', 'n_tokens_mistral': 4167, 'n_tokens_neox': 3908, 'n_words': 403}