/mob_synchronization.py

l.789 in def _get_product_array

######## Sync Product Taxes ########
get_product_data['cost'] = obj_pro.standard_price or 0.00
if obj_pro.taxes_id:
for tax in obj_pro.taxes_id:
tax_id = tax.id
if tax_id == 12:
get_product_data['tax_class_id'] = '1'
if tax_id == 13:
get_product_data['tax_class_id'] = '2'

######### Product Brand for use with OCA/product-attributes/product_brand #########
odoo_brand_id = obj_pro.product_brand_id.id
if odoo_brand_id:
mage_brand_id = self.pool.get('product.brand').browse(cr, uid, odoo_brand_id).magento_brand_id
if mage_brand_id:
get_product_data['manufacturer'] = mage_brand_id
else:
get_product_data['manufacturer'] = False
else:
get_product_data['manufacturer'] = False

######### Product Kunstler #########
odoo_kunstler_id = obj_pro.product_kunstler_id.id
if odoo_kunstler_id:
mage_kunstler_id = self.pool.get('product.kunstler').browse(cr, uid, odoo_kunstler_id).magento_kunstler_id
if mage_kunstler_id:
get_product_data['kunstler'] = mage_kunstler_id
else:
get_product_data['kunstler'] = False
else:
get_product_data['kunstler'] = False

/core_overrides.py


l.80 in def create
if vals.has_key('product_brand_id'):
brand_id = vals.get('product_brand_id')
search_brand = self.pool.get('product.brand').search(cr, uid, [('magento_brand_id','=',brand_id)])
_logger.info("Sync Manufacturer Attribute: %r", search_brand)
if search_brand:
vals['product_brand_id'] = search_brand[0]
else:
vals.pop('product_brand_id')
if vals.has_key('product_kunstler_id'):
kunstler_id = vals.get('product_kunstler_id')
search_kunstler = self.pool.get('product.kunstler').search(cr, uid, [('magento_kunstler_id','=',kunstler_id)])
_logger.info("Sync Kunstler Attribute: %r", search_kunstler)
if search_kunstler:
vals['product_kunstler_id'] = search_kunstler[0]
else:
vals.pop('product_kunstler_id')

l.133 in def write

if vals.has_key('product_brand_id'):
brand_id = vals.get('product_brand_id')
search_brand = self.pool.get('product.brand').search(cr, uid, [('magento_brand_id','=',brand_id)])
_logger.info("Search Webkul Manufacturer Attribute Test Sync : %r", search_brand)
if search_brand:
vals['product_brand_id'] = search_brand[0]
else:
vals.pop('product_brand_id')

#_logger.info("Webkul Kunstler Attribute Test Sync")
if vals.has_key('product_kunstler_id'):
kunstler_id = vals.get('product_kunstler_id')
search_kunstler = self.pool.get('product.kunstler').search(cr, uid, [('magento_kunstler_id','=',kunstler_id)])
_logger.info("Search Webkul Manufacturer Attribute Test Sync : %r", search_kunstler)
if search_kunstler:
vals['product_kunstler_id'] = search_kunstler[0]
else:
vals.pop('product_kunstler_id')