add_product(serial,product_id,product_name,quantity,must_have_xlsx=True,allow_recursive_part_ref=config.allow_part_tree_reference)# first-level recursive is enabled. Update: controlled by config, should never switched on.
add_product(serial,product_id,product_name,quantity,load_xlsx=True,allow_recursive_part_ref=True)# first-level recursive is enabled.
log_warn('Self-reference detected on part {}. Skipping recursive walking.'.format(_id))
log_warn('Self-reference detected on part {}. Skipping recursive walking.'.format(_id))
else:
else:
ifadd_product(serial,part_id,part_name,stoi(quantity)*stoi(line_ar[config.part_quantity_col_index]),allow_recursive_part_ref=config.allow_part_tree_reference):# If found sub-part xlsx:
ifadd_product(serial,part_id,part_name,stoi(quantity)*stoi(line_ar[config.part_quantity_col_index]),load_xlsx=config.allow_part_tree_reference,allow_recursive_part_ref=config.allow_part_tree_reference):# If found sub-part xlsx:
continue# DO not put the parent material into csv_buf again!
continue# DO not put the parent material into csv_buf again!
# put line into csv_buf
# put line into csv_buf
csv_preprocess.npmat2csv(line,csv_buf)
csv_preprocess.npmat2csv(line,csv_buf)
else:
ifmust_have_xlsx:
name_and_id='{}({})'.format(name,_id)
log_error('Error: Unable to find xls for {} (xls/xlsm/xlsx)'.format(name_and_id))