'context': context }) # STEP 5: Product Variant product_mapping = { 'id': mapper.m2o_map(PRODUCT_PREFIX, mapper.concat('_', 'barcode', 'Color', 'Gender', 'Size_H', 'Size_W'), skip=True), 'barcode': mapper.val('barcode'), 'product_tmpl_id/id': mapper.m2o(TEMPLATE_PREFIX, 'ref'), 'attribute_value_ids/id': mapper.m2m_attribute_value(ATTRIBUTE_VALUE_PREFIX, 'Color', 'Gender', 'Size_H', 'Size_W'), } processor.process( product_mapping, 'data%sproduct.product.csv' % os.sep, { 'worker': 3, 'batch_size': 50, 'groupby': 'product_tmpl_id/id', 'context': context }, 'set') # Step 6: Define output and import parameter processor.write_output() launchfile_write(processor.file_to_write, "3_product_import.sh", python_exe='python-coverage run -a', path='../')
# STEP 4: Attribute List attribute_list = ['Color', 'Gender', 'Size_H', 'Size_W'] attribue_value_mapping = { 'id': mapper.m2o_att(ATTRIBUTE_VALUE_PREFIX, attribute_list), # TODO 'name': mapper.val_att(attribute_list), # TODO 'attribute_id/id': mapper.m2o_att_name(ATTRIBUTE_PREFIX, attribute_list), } line_mapping = { 'product_tmpl_id/id': mapper.m2o(TEMPLATE_PREFIX, 'ref'), 'attribute_id/id': mapper.m2o_att_name(ATTRIBUTE_PREFIX, attribute_list), 'value_ids/id': mapper.m2o_att(ATTRIBUTE_VALUE_PREFIX, attribute_list) # TODO } processor.process_attribute_mapping(attribue_value_mapping, line_mapping, attribute_list, ATTRIBUTE_PREFIX, 'data/', {'worker': 3, 'batch_size': 50, 'context': context}) # STEP 5: Product Variant product_mapping = { 'id': mapper.m2o_map(PRODUCT_PREFIX, mapper.concat('_', 'barcode', 'Color', 'Gender', 'Size_H', 'Size_W'), skip=True), 'barcode': mapper.val('barcode'), 'product_tmpl_id/id': mapper.m2o(TEMPLATE_PREFIX, 'ref'), 'attribute_value_ids/id': mapper.m2m_attribute_value(ATTRIBUTE_VALUE_PREFIX, 'Color', 'Gender', 'Size_H', 'Size_W'), } processor.process(product_mapping, 'data%sproduct.product.csv' % os.sep, {'worker': 3, 'batch_size': 50, 'groupby': 'product_tmpl_id/id', 'context': context}, 'set') # Step 6: Define output and import parameter processor.write_to_file("3_product_import.sh", python_exe=EXEC, path='../')