openerp-canada team mailing list archive
-
openerp-canada team
-
Mailing list archive
-
Message #00032
lp:~openerp-canada/magentoerpconnect/openerp6-module-for-magento15 into lp:magentoerpconnect/openerp6-module
Maxime Chambreuil (http://www.savoirfairelinux.com) has proposed merging lp:~openerp-canada/magentoerpconnect/openerp6-module-for-magento15 into lp:magentoerpconnect/openerp6-module.
Requested reviews:
MagentoERPConnect core editors (magentoerpconnect-core-editors)
For more details, see:
https://code.launchpad.net/~openerp-canada/magentoerpconnect/openerp6-module-for-magento15/+merge/67429
[IMP] For Magento 1.5
--
https://code.launchpad.net/~openerp-canada/magentoerpconnect/openerp6-module-for-magento15/+merge/67429
Your team OpenERP Canada Team is subscribed to branch lp:~openerp-canada/magentoerpconnect/openerp6-module-for-magento15.
=== modified file 'magentoerpconnect/product.py'
--- magentoerpconnect/product.py 2011-06-20 14:03:54 +0000
+++ magentoerpconnect/product.py 2011-07-09 17:11:39 +0000
@@ -75,14 +75,16 @@
('name', 'Name'),
('price', 'Price')
], 'Default Product Listing Sort (Sort By)'),
- 'magerp_stamp':fields.datetime('Magento stamp')
+ 'magerp_stamp':fields.datetime('Magento stamp'),
+ 'include_in_menu': fields.boolean('Include in Navigation Menu')
}
_defaults = {
'display_mode':lambda * a:'PRODUCTS',
'available_sort_by':lambda * a:'None',
'default_sort_by':lambda * a:'None',
- 'level':lambda * a:1
- }
+ 'level':lambda * a:1,
+ 'include_in_menu':lambda * a:True
+ }
def write(self, cr, uid, ids, vals, context=None):
if not 'magerp_stamp' in vals.keys():
=== modified file 'magentoerpconnect/product_view.xml'
--- magentoerpconnect/product_view.xml 2011-06-07 12:19:50 +0000
+++ magentoerpconnect/product_view.xml 2011-07-09 17:11:39 +0000
@@ -22,6 +22,7 @@
<field name="meta_description" colspan="2" />
<field name="url_key" colspan="2" />
<field name="level" colspan="2" />
+ <field name="include_in_menu" colspan="2" />
</group>
<group col="1" colspan="1">
<separator string="Category Image" />
=== modified file 'magentoerpconnect/settings/external.mapping.template.csv'
--- magentoerpconnect/settings/external.mapping.template.csv 2010-11-04 20:01:34 +0000
+++ magentoerpconnect/settings/external.mapping.template.csv 2011-07-09 17:11:39 +0000
@@ -12,3 +12,16 @@
"magento_cst_grp","magento1324","base.model_res_partner_category","ol_customer_groups.list",,,,,"customer_group_id"
"magento_prt_adr","magento1324","base.model_res_partner_address","ol_customer_address.list","ol_customer_address.info",,,,"customer_address_id"
"magento_prt","magento1324","base.model_res_partner","customer.list","customer.info","customer.update",,,"customer_id"
+"magento_website","magento15","base_sale_multichannels.model_external_shop_group","ol_websites.list",,,,,"website_id"
+"magento_storeview","magento15","model_magerp_storeviews","ol_storeviews.list",,,,,"store_id"
+"magento_store","magento15","sale.model_sale_shop","ol_groups.list",,,,,"group_id"
+"magento_order","magento15","sale.model_sale_order","sales_order.list","sales_order.info",,,,"increment_id"
+"magento_order_line","magento15","sale.model_sale_order_line",,,,,,"item_id"
+"magento_pro_cat","magento15","product.model_product_category","category.list","category.info","catalog_category.update","catalog_category.create",,"category_id"
+"magento_attr_grp","magento15","model_magerp_product_attribute_groups","ol_catalog_product_attribute_group.list","ol_catalog_product_attribute_group.list",,,,"attribute_group_id"
+"magento_attr_set","magento15","model_magerp_product_attribute_set","ol_catalog_product_attributeset.list",,,,,"attribute_set_id"
+"magento_attr","magento15","model_magerp_product_attributes","ol_catalog_product_attribute.list",,,,,"magento_id"
+"magento_prd","magento15","product.model_product_product","catalog_product.list","catalog_product.info","product.update","product.create",,"product_id"
+"magento_cst_grp","magento15","base.model_res_partner_category","ol_customer_groups.list",,,,,"customer_group_id"
+"magento_prt_adr","magento15","base.model_res_partner_address","ol_customer_address.list","ol_customer_address.info",,,,"customer_address_id"
+"magento_prt","magento15","base.model_res_partner","customer.list","customer.info","customer.update",,,"customer_id"
=== modified file 'magentoerpconnect/settings/external.mappinglines.template.csv'
--- magentoerpconnect/settings/external.mappinglines.template.csv 2011-06-20 14:16:05 +0000
+++ magentoerpconnect/settings/external.mappinglines.template.csv 2011-07-09 17:11:39 +0000
@@ -170,22 +170,18 @@
"mag_erp_prd_15","magento1324","product.model_product_product","websites","in_out","str","websites_ids = []
for ext_id in eval(ifield):
websites_ids.append(self.pool.get('external.shop.group').extid_to_oeid(cr, uid, ext_id, external_referential_id))
-
##### 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', '=', external_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 not record['websites_ids']:
record['websites_ids'] = self.pool.get('external.shop.group').search(cr,uid,[('referential_id', '=', external_referential_id)])
##### OPTION END
-
ext_websites_ids = []
for oe_id in record['websites_ids']:
ext_websites_ids.append(self.pool.get('external.shop.group').oeid_to_extid(cr, uid, oe_id, external_referential_id))
-
result=[('websites', ext_websites_ids)]"
"magento_cst_grp_1","magento1324","base.model_res_partner_category","customer_group_code","in","str","result=[('name',ifield)]",
"magento_cst_grp_3","magento1324","base.model_res_partner_category","tax_class_id","in","int","result=[('tax_class_id',ifield)]",
@@ -257,3 +253,240 @@
result =[('mag_birthday',ifield[:10])]
else:
result=[]",
+"mag_erp_s_name","magento15","base_sale_multichannels.model_external_shop_group","name","in_out","str","result=[('name',ifield)]","result=[('name',record['name'])]"
+"mag_erp_s_code","magento15","base_sale_multichannels.model_external_shop_group","code","in_out","str","result=[('code',ifield)]",
+"mag_erp_s_web","magento15","base_sale_multichannels.model_external_shop_group","website_id","in_out","int","result=[('website_id',ifield)]",
+"mag_erp_s_isa","magento15","base_sale_multichannels.model_external_shop_group","is_default","in_out","str","result=[('is_default',bool(eval(ifield)))]",
+"mag_erp_s_stord","magento15","base_sale_multichannels.model_external_shop_group","sort_order","in_out","int","result=[('sort_order',ifield)]",
+"mag_erp_s_gpid","magento15","base_sale_multichannels.model_external_shop_group","default_group_id","in_out","int","result=[('default_shop_integer_id',ifield)]",
+"mag_erp_sv_name","magento15","model_magerp_storeviews","name","in_out","str","result=[('name',ifield)]","result=[('name',record['name'])]"
+"mag_erp_sv_code","magento15","model_magerp_storeviews","code","in_out","str","result=[('code',ifield)]",
+"mag_erp_sv_sg","magento15","model_magerp_storeviews","website_id","in_out","int","result=[('website_id',self.pool.get('external.shop.group').extid_to_oeid(cr, uid, ifield, external_referential_id))]",
+"mag_erp_sv_isa","magento15","model_magerp_storeviews","is_active","in_out","str","result=[('is_active',bool(eval(ifield)))]",
+"mag_erp_sv_stord","magento15","model_magerp_storeviews","sort_order","in_out","int","result=[('sort_order',ifield)]",
+"mag_erp_sv_gpid","magento15","model_magerp_storeviews","group_id","in_out","int","result=[('shop_id',self.pool.get('sale.shop').extid_to_oeid(cr, uid, ifield, external_referential_id))]",
+"mag_erp_st_name","magento15","sale.model_sale_shop","name","in_out","str","result=[('name',ifield)]","result=[('name',record['name'])]"
+"mag_erp_st_gpid","magento15","sale.model_sale_shop","group_id","in_out","int","result=[('group_id',ifield)]",
+"mag_erp_st_grp","magento15","sale.model_sale_shop","website_id","in_out","int","result=[('shop_group_id',self.pool.get('external.shop.group').extid_to_oeid(cr, uid, ifield, external_referential_id))]",
+"mag_erp_st_default_st","magento15","sale.model_sale_shop","default_store_id","in_out","int","result=[('default_storeview_integer_id',ifield)]",
+"mag_erp_st_root_categ","magento15","sale.model_sale_shop","root_category_id","in_out","int","result=[('root_category_id',ifield)]",
+"mag_erp_so_name","magento15","sale.model_sale_order","increment_id","in_out","str","result=[('magento_incrementid',str(ifield)), ('name','mag_' + str(ifield))]",
+"mag_erp_so_carrier_id","magento15","sale.model_sale_order","shipping_method","in_out","str","if not ifield:
+ result = []
+else:
+ carrier_ids = self.pool.get('delivery.carrier').search(cr, uid, [('magento_code', '=', ifield)])
+ if carrier_ids:
+ result=[('carrier_id', carrier_ids[0])]
+ else:
+ result=[]",
+"mag_erp_so_pay","magento15","sale.model_sale_order","payment","in_out","str","
+payments_mapping = {'checkmo': 'manual', 'ccsave': 'prepaid', 'free':'prepaid','googlecheckout':'prepaid','paypayl_express':'prepaid', 'paybox_system': 'prepaid', 'paypal_standard': 'prepaid', 'cashondelivery': 'manual', 'servired_standard': 'prepaid', 'bbva': 'prepaid', 'cofidis': 'prepaid'}
+ifield=eval(ifield)
+result=[('order_policy', ifield['method'] in payments_mapping and payments_mapping[ifield['method']] or 'prepaid'), ('ext_payment_method', ifield['method'])]",
+"mag_erp_soline_name","magento15","sale.model_sale_order_line","name","in_out","str","result=[('name',ifield)]",
+"mag_erp_soline_pid","magento15","sale.model_sale_order_line","product_id","in_out","str","context['alternative_key'] = data['sku']
+result=[('product_id',self.pool.get('product.product').extid_to_oeid(cr, uid, ifield, external_referential_id))]",
+"mag_erp_soline_uomqty","magento15","sale.model_sale_order_line","qty_ordered","in_out","str","result=[('product_uom_qty',ifield)]",
+"mag_erp_soline_uosqty","magento15","sale.model_sale_order_line","qty_ordered","in","str","result=[('product_uos_qty',ifield)]",
+"mag_erp_soline_price","magento15","sale.model_sale_order_line","price","in","str","result=[('price_unit', float(data['row_total'])/float(data['qty_ordered']))]",
+"mag_erp_soline_disc","magento15","sale.model_sale_order_line","discount_amount","in","str","result=[('discount', float(data['price']) != 0 and float(data['qty_ordered']) != 0 and float(100*float(ifield))/(float(data['price'])*float(data['qty_ordered'])) or 0)]",
+"mag_erp_procat_2","magento15","product.model_product_category","level","in","int","result=[('sequence',ifield),('level',ifield)]",
+"mag_erp_procat_3","magento15","product.model_product_category","parent_id","in_out","int","record_id = self.pool.get('ir.model.data').search(cr, uid, [('model', '=', self._name), ('name', '=', self.prefixed_id(ifield))])
+parent_id = False
+if record_id:
+ parent_rec = self.pool.get('ir.model.data').read(cr,uid,record_id[0],[])
+ parent_id=parent_rec.get('res_id',False)
+result=[('magento_parent_id',ifield),('parent_id',parent_id)]","magento_parent_id = False
+if record.get('parent_id',False):
+ magento_parent_id = self.oeid_to_extid(cr, uid, record.get('parent_id')[0], external_referential_id)
+ if not magento_parent_id:
+ self.ext_export(cr,uid,[record.get('parent_id',[False])[0]],[external_referential_id],{},{'conn_obj':conn})
+ magento_parent_id = self.oeid_to_extid(cr, uid, record.get('parent_id')[0], external_referential_id)
+if magento_parent_id:
+ result = [('parent_id',magento_parent_id)]"
+"mag_erp_procat_4","magento15","product.model_product_category","is_active","in_out","str","result=[('is_active',ifield and (eval(ifield)) or False)]","result=[('is_active',record['is_active'])]"
+"mag_erp_procat_5","magento15","product.model_product_category","description","in_out","str","result=[('description',ifield)]","result=[('description',record['description'])]"
+"mag_erp_procat_6","magento15","product.model_product_category","meta_title","in_out","str","result=[('meta_title',ifield)]","result=[('meta_title',record['meta_title'])]"
+"mag_erp_procat_7","magento15","product.model_product_category","meta_keywords","in_out","str","result=[('meta_keywords',ifield)]","result=[('meta_keywords',record['meta_keywords'])]"
+"mag_erp_procat_8","magento15","product.model_product_category","meta_description","in_out","str","result=[('meta_description',ifield)]","result=[('meta_description',record['meta_description'])]"
+"mag_erp_procat_9","magento15","product.model_product_category","url_key","in_out","str","result=[('url_key',ifield)]","result=[('url_key',record['url_key'])]"
+"mag_erp_procat_10","magento15","product.model_product_category","name","in_out","str","result=[('name',ifield or 'UNDEFINED'),('magento_exportable',True)]","result=[('name',record['name'])]"
+"mag_erp_procat_11","magento15","product.model_product_category","is_anchor","in_out","str","result=[('is_anchor',ifield and bool(eval(ifield)) or False)]","result=[('is_anchor',record['is_anchor'])]"
+"mag_erp_procat_12","magento15","product.model_product_category","available_sort_by","in_out","str","result=[('available_sort_by',ifield)]","result=[('available_sort_by',record['available_sort_by'] or 'name')]"
+"mag_erp_procat_13","magento15","product.model_product_category","default_sort_by","in_out","str","result=[('default_sort_by',ifield)]","result=[('default_sort_by',record['default_sort_by'] or 'name')]"
+"mag_erp_procat_14","magento15","product.model_product_category","updated_at","in","str","result=[('magerp_stamp',ifield)]",
+"mag_erp_procat_15","magento15","product.model_product_category","image","in_out","str","image_binary = False
+if ifield and not ifield=='None':
+ try:
+ image_binary = conn.call('ol_catalog_category_media.info', [int(data['category_id'])])
+ except Exception, e:
+ print e
+ pass
+ if image_binary:
+ image_binary = base64.encodestring(base64.urlsafe_b64decode(image_binary[0]['image_data']))
+result=[('image_name',ifield),('image',image_binary)]","if record['image']:
+ img = base64.decodestring(record['image'])
+ img_bin_enc = base64.encodestring(img)
+ conn.call('ol_catalog_category_media.create', [record['image_name'], img_bin_enc])
+ result = [('image',record['image_name'])]
+else:
+ result=[]"
+"mag_erp_procat_16","magento15","product.model_product_category","include_in_menu","in_out","str","result=[('include_in_menu', ifield and (eval(ifield)) or False)]","result=[('include_in_menu', record['include_in_menu'])]"
+"mag_erp_attrgrp_2","magento15","model_magerp_product_attribute_groups","attribute_set_id","in_out","int","result=[('attribute_set_id', ifield)]","result=[('attribute_set_id', record['attribute_set_id'])]"
+"mag_erp_attrgrp_3","magento15","model_magerp_product_attribute_groups","attribute_group_name","in_out","str","result=[('attribute_group_name', ifield)]","result=[('attribute_group_name', record['attribute_group_name'])]"
+"mag_erp_attrgrp_4","magento15","model_magerp_product_attribute_groups","sort_order","in_out","int","result=[('sort_order', ifield)]","result=[('sort_order', record['sort_order'])]"
+"mag_erp_attrgrp_5","magento15","model_magerp_product_attribute_groups","default_id","in_out","int","result=[('default_id', ifield)]","result=[('default_id', record['default_id'])]"
+"mag_erp_attrset_1","magento15","model_magerp_product_attribute_set","attribute_set_id","in_out","int","result=[('magento_id', ifield)]","result=[('attribute_set_id', record['magento_id'])]"
+"mag_erp_attrset_2","magento15","model_magerp_product_attribute_set","sort_order","in_out","int","result=[('sort_order', ifield)]","result=[('sort_order', record['sort_order'])]"
+"mag_erp_attrset_3","magento15","model_magerp_product_attribute_set","attribute_set_name","in_out","str","result=[('attribute_set_name', ifield)]","result=[('attribute_set_name', record['attribute_set_name'])]"
+"mag_erp_attr_1","magento15","model_magerp_product_attributes","attribute_code","in_out","str","result=[('attribute_code', ifield)]","result=[('code', record['attribute_code'])]"
+"mag_erp_attr_2","magento15","model_magerp_product_attributes","attribute_id","in_out","int","result=[('magento_id', ifield)]",
+"mag_erp_attr_3","magento15","model_magerp_product_attributes","frontend_input","in_out","str","result=[('frontend_input', ifield)]","result=[('frontend_input', record['frontend_input'])]"
+"mag_erp_attr_4","magento15","model_magerp_product_attributes","frontend_class","in_out","str","result=[('frontend_class', ifield)]","result=[('frontend_class', record['frontend_class'])]"
+"mag_erp_attr_5","magento15","model_magerp_product_attributes","backend_model","in_out","str","result=[('backend_model', ifield)]","result=[('backend_model', record['backend_model'])]"
+"mag_erp_attr_6","magento15","model_magerp_product_attributes","backend_type","in_out","str","result=[('backend_type', ifield)]","result=[('backend_type', record['backend_type'])]"
+"mag_erp_attr_7","magento15","model_magerp_product_attributes","frontend_label","in_out","str","result=[('frontend_label', ifield)]","result=[('frontend_label', record['frontend_label'])]"
+"mag_erp_attr_8","magento15","model_magerp_product_attributes","is_visible_in_advanced_search","in_out","str","result=[('is_visible_in_advanced_search', bool(eval(ifield)))]","result=[('is_visible_in_advanced_search', record['is_visible_in_advanced_search'])]"
+"mag_erp_attr_9","magento15","model_magerp_product_attributes","is_global","in_out","str","result=[('is_global', bool(eval(ifield)))]","result=[('is_global', record['is_global'])]"
+"mag_erp_attr_10","magento15","model_magerp_product_attributes","is_filterable","in_out","str","result=[('is_filterable', bool(eval(ifield)))]","result=[('is_filterable', record['is_filterable'])]"
+"mag_erp_attr_11","magento15","model_magerp_product_attributes","is_comparable","in_out","str","result=[('is_comparable', bool(eval(ifield)))]","result=[('is_comparable', record['is_comparable'])]"
+"mag_erp_attr_12","magento15","model_magerp_product_attributes","is_visible","in_out","str","result=[('is_visible', bool(eval(ifield)))]","result=[('is_visible', record['is_visible'])]"
+"mag_erp_attr_13","magento15","model_magerp_product_attributes","is_searchable","in_out","str","result=[('is_searchable', bool(eval(ifield)))]","result=[('is_searchable', record['is_searchable'])]"
+"mag_erp_attr_14","magento15","model_magerp_product_attributes","is_user_defined","in_out","str","result=[('is_user_defined', bool(eval(ifield)))]","result=[('is_user_defined', record['is_user_defined'])]"
+"mag_erp_attr_15","magento15","model_magerp_product_attributes","is_configurable","in_out","str","result=[('is_configurable', bool(eval(ifield)))]","result=[('is_configurable', record['is_configurable'])]"
+"mag_erp_attr_16","magento15","model_magerp_product_attributes","is_visible_on_front","in_out","str","result=[('is_visible_on_front', bool(eval(ifield)))]","result=[('is_visible_on_front', record['is_visible_on_front'])]"
+"mag_erp_attr_17","magento15","model_magerp_product_attributes","is_used_for_price_rules","in_out","str","result=[('is_used_for_price_rules', bool(eval(ifield)))]","result=[('is_used_for_price_rules', record['is_used_for_price_rules'])]"
+"mag_erp_attr_18","magento15","model_magerp_product_attributes","is_unique","in_out","str","result=[('is_unique', bool(eval(ifield)))]","result=[('is_unique', record['is_unique'])]"
+"mag_erp_attr_19","magento15","model_magerp_product_attributes","is_required","in_out","str","result=[('is_required', bool(eval(ifield)))]","result=[('is_required', record['is_required'])]"
+"mag_erp_attr_20","magento15","model_magerp_product_attributes","position","in_out","int","result=[('position', ifield)]","result=[('position', record['position'])]"
+"mag_erp_attr_21","magento15","model_magerp_product_attributes","attribute_set_info","in_out","str","result=[('attribute_set_info', ifield)]","result=[('attribute_set_info', record['attribute_set_info'])]"
+"mag_erp_attr_22","magento15","model_magerp_product_attributes","default_value","in_out","str","result=[('default_value', ifield)]","result=[('default_value', record['default_value'])]"
+"mag_erp_attr_23","magento15","model_magerp_product_attributes","note","in_out","str","result=[('note', ifield)]","result=[('note', record['note'])]"
+"mag_erp_attr_24","magento15","model_magerp_product_attributes","entity_type_id","in_out","int","result=[('entity_type_id', ifield)]","result=[('entity_type_id', record['entity_type_id'])]"
+"mag_erp_attr_25","magento15","model_magerp_product_attributes","apply_to","in_out","str","result=[('apply_to', str(ifield))]","result=[('apply_to', eval(record['%s']))]"
+"mag_erp_prd_1","magento15","product.model_product_product","url_key","in_out","str","result=[('x_magerp_url_key',ifield)]","if context.get('export_url', False) :
+ result=[('url_key',record['x_magerp_url_key'])]"
+"mag_erp_prd_2","magento15","product.model_product_product","name","in_out","str","result = [('name',ifield)]","result = [('name',record['name'])]"
+"mag_erp_prd_3","magento15","product.model_product_product","description","in_out","str","result = [('description',ifield)]",
+"mag_erp_prd_4","magento15","product.model_product_product","short_description","in_out","str","result = [('description_sale',ifield)]",
+"mag_erp_prd_5","magento15","product.model_product_product","sku","in_out","str","result = [('magento_sku',ifield), ('default_code',ifield)]",
+"mag_erp_prd_6","magento15","product.model_product_product","weight","in_out","float","result = [('weight_net',ifield)]","result = [('weight',record['weight_net'] or 0)]"
+"mag_erp_prd_7","magento15","product.model_product_product","categories","in_out","str","categ_ids =[]
+if len(eval(ifield)) > 0:
+ for category_ids in eval(ifield):
+ categ_ids.append(self.pool.get('product.category').extid_to_oeid(cr, uid, category_ids, external_referential_id))
+ categ_id = categ_ids.pop()
+else:
+ categ_id = self.pool.get('external.referential').browse(cr, uid, external_referential_id).default_pro_cat.id
+result = [('categ_id', categ_id), ('categ_ids',[(6, 0, categ_ids)])]","
+product = self.browse(cr, uid, record['id'])
+main_categ_id = self.pool.get('product.category').oeid_to_extid(cr, uid, product.categ_id.id, external_referential_id)
+categ_ids = [main_categ_id]
+for categ in product.categ_ids: #deal with extra m2m categories
+ categ_id = self.pool.get('product.category').oeid_to_extid(cr, uid, categ.id, external_referential_id)
+ if categ_id:
+ categ_ids.append(categ_id)
+result=[('categories', categ_ids)]"
+"mag_erp_prd_8","magento15","product.model_product_product","price","in_out","float","result=[('list_price',ifield)]","result=[]#map later"
+"mag_erp_prd_9","magento15","product.model_product_product","cost","in_out","float","result=[('standard_price',ifield)]","result = [('cost',record['standard_price'] or 0)]"
+"mag_erp_prd_10","magento15","product.model_product_product","set","in_out","str","result=[('set',self.pool.get('magerp.product_attribute_set').extid_to_oeid(cr, uid, ifield, external_referential_id))]",
+"mag_erp_prd_11","magento15","product.model_product_product","special_price","in_out","float","result = [('x_magerp_special_price',ifield)]",""
+"mag_erp_prd_12","magento15","product.model_product_product","tier_price","in_out","str","result=[]#no mapping by default","result=[]#no mapping by default"
+"mag_erp_prd_13","magento15","product.model_product_product","minimal_price","in_out","float","result = [('x_magerp_minimal_price',ifield)]","
+if record['x_magerp_minimal_price'] and record['x_magerp_minimal_price'] != 0:
+ result = [('minimal_price',record['x_magerp_minimal_price'])]
+else:
+ result = [('minimal_price',False)]"
+"mag_erp_prd_14","magento15","product.model_product_product","type_id","in_out","str","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 'product_type' in record and record['product_type']:
+ result = [('type_id',record['product_type'])]
+else:
+ result = [('type_id','simple')]"
+"mag_erp_prd_15","magento15","product.model_product_product","websites","in_out","str","websites_ids = []
+for ext_id in eval(ifield):
+ websites_ids.append(self.pool.get('external.shop.group').extid_to_oeid(cr, uid, ext_id, external_referential_id))
+##### 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', '=', external_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 not record['websites_ids']:
+ record['websites_ids'] = self.pool.get('external.shop.group').search(cr,uid,[('referential_id', '=', external_referential_id)])
+##### OPTION END
+ext_websites_ids = []
+for oe_id in record['websites_ids']:
+ ext_websites_ids.append(self.pool.get('external.shop.group').oeid_to_extid(cr, uid, oe_id, external_referential_id))
+result=[('websites', ext_websites_ids)]"
+"magento_cst_grp_1","magento15","base.model_res_partner_category","customer_group_code","in","str","result=[('name',ifield)]",
+"magento_cst_grp_3","magento15","base.model_res_partner_category","tax_class_id","in","int","result=[('tax_class_id',ifield)]",
+"magento_prt_adr_2","magento15","base.model_res_partner_address","city","in_out","str","result=[('city',ifield)]",
+"magento_prt_adr_3","magento15","base.model_res_partner_address","fax","in_out","str","result=[('fax',ifield)]",
+"magento_prt_adr_4","magento15","base.model_res_partner_address","firstname","in_out","str","result = [('name', (data.get('company', False) and (data['company'] + ' ; ') or '') + ifield + ' ' + data['lastname']), ('firstname', ifield), ('lastname', data['lastname'])]",
+"magento_prt_adr_6","magento15","base.model_res_partner_address","is_active","in_out","str","result=[('active',bool(eval(ifield)))]",
+"magento_prt_adr_7","magento15","base.model_res_partner_address","country_id","in_out","str","result = self.pool.get('res.country').search(cr,uid,[('code','=',ifield)])
+if result and len(result)==1:
+ result=[('country_id',result[0])]
+else:
+ result=[]
+",
+"magento_prt_adr_8","magento15","base.model_res_partner_address","street","in_out","str","if ifield:
+ if len(ifield.split('\n')) ==2 :
+ result = [('street', ifield.split('\n')[0]) , ('street2', ifield.split('\n')[1])]
+ else :
+ result = [('street',ifield.replace('\\n',','))]
+else:
+ result = []",
+"magento_prt_adr_9","magento15","base.model_res_partner_address","postcode","in_out","str","result=[('zip',ifield)]",
+"magento_prt_adr_10","magento15","base.model_res_partner_address","telephone","in_out","str","result=[('phone',ifield)]",
+"magento_prt_adr_11","magento15","base.model_res_partner_address","region","in_out","str","if ifield:
+ result = self.pool.get('res.country.state').search(cr,uid,[('name','ilike',ifield)])
+ if result and len(result)==1:
+ result = [('state_id',result[0])]
+ else:
+ result=[]
+else:
+ result=[]",
+"magento_prt_adr_13","magento15","base.model_res_partner_address","customer_id","in_out","int","result=self.pool.get('res.partner').extid_to_oeid(cr,uid,ifield,external_referential_id)
+if result:
+ result=[('partner_id',result)]
+else:
+ result=[('partner_id',False)]",
+"magento_prt_adr_14","magento15","base.model_res_partner_address","address_type","in_out","str","if ifield=='billing':
+ result=[('type','invoice')]
+elif ifield=='shipping':
+ result=[('type','delivery')]
+else:
+ result=[]",
+"magento_prt_adr_15","magento15","base.model_res_partner_address","email","in_out","str","result=[('email',ifield)]",
+"magento_prt_2","magento15","base.model_res_partner","group_id","in_out","int","if ifield:
+ result=self.pool.get('res.partner.category').extid_to_oeid(cr,uid,ifield,external_referential_id)
+ if result:
+ result=[('group_id',result)]",
+"magento_prt_3","magento15","base.model_res_partner","store_id","in_out","int","if ifield:
+ result=self.pool.get('magerp.storeviews').extid_to_oeid(cr,uid,ifield,external_referential_id)
+ if result:
+ lang = self.pool.get('magerp.storeviews').browse(cr, uid, result).lang_id
+ result=[('store_id',result),('lang',lang and lang.code or False)]",
+"magento_prt_4","magento15","base.model_res_partner","website_id","in_out","int","if ifield:
+ result=self.pool.get('external.shop.group').extid_to_oeid(cr,uid,ifield,external_referential_id)
+ if result:
+ result=[('website_id',result)]",
+"magento_prt_5","magento15","base.model_res_partner","created_in","in_out","str","result=[('created_in',ifield)]",
+"magento_prt_6","magento15","base.model_res_partner","created_at","in_out","str","result=[('created_at',ifield)]",
+"magento_prt_7","magento15","base.model_res_partner","updated_at","in_out","str","result=[('updated_at',ifield)]",
+"magento_prt_8","magento15","base.model_res_partner","firstname","in_out","str","result = [('name', ifield + ' ' + data['lastname'])]","add_id = self.browse(cr, uid, record['id'])
+fn = add_id.address[0].firstname
+ln = add_id.address[0].lastname
+result=[('firstname', fn), ('lastname', ln)]"
+"magento_prt_10","magento15","base.model_res_partner","email","in_out","str","result=[('emailid',ifield)]",
+"magento_prt_11","magento15","base.model_res_partner","taxvat","in_out","str","if ifield:
+ result=[('mag_vat',ifield)]
+else:
+ result=[]",
+"magento_prt_12","magento15","base.model_res_partner","dob","in_out","str","if ifield:
+ result =[('mag_birthday',ifield[:10])]
+else:
+ result=[]",
=== modified file 'magentoerpconnect/settings/external.referential.type.csv'
--- magentoerpconnect/settings/external.referential.type.csv 2010-12-14 21:03:15 +0000
+++ magentoerpconnect/settings/external.referential.type.csv 2011-07-09 17:11:39 +0000
@@ -1,2 +1,3 @@
"id","name"
"magento1324","Magento Version 1.3.2.4+"
+"magento15","Magento Version 1.5"
Follow ups