I think I've just experienced the same problem:
- created a custom multiselect attribute with a custom source model
for a product.
- the label was 'human readable' and the value was an alphanumeric
code.
- used the alphanumeric code in a csv product import file.
- tried to use the Magento import to load a product with this
attribute.
- Got the error: Invalid value for 'test_attr' in rows: 1
After some debugging this seems to be because:
- Mage_ImportExport_Model_Import_Entity_Abstract#isAttributeValid(..) reports the attribute value is invalid (the case 'multiselect' line).
- this is because it is checking the value from the csv file (alphanumeric code) and finding it wasn't in the list of valid options for this attribute. This is because its list of valid options contained the label.
- The reason the list of options contains the label and not the value/code is because in Mage_ImportExport_Model_Import_Entity_Abstract#getAttributeOptions(..) it decides to use the label because the attribute isn't in an array of attributes that values should be used for. This array is declared in Mage_ImportExport_Model_Import_Entity_Abstract:
protected $_indexValueAttributes = array(
'status',
'tax_class_id',
'visibility',
'enable_googlecheckout',
'gift_message_available',
'custom_design'
);
So, the answer is to use in the csv file the label for the attribute. Or to overwrite Mage_ImportExport_Model_Import_Entity_Abstract to get your attribute into the array of attributes for which the value and not the label is expected during product imports.