I am trying to add a quantity to return to stock data to the credit memo item.
I have made 2 install scripts. One adds a column to the database
<?php $installer = $this; $installer->startSetup(); $installer->run(" ALTER TABLE sales_flat_creditmemo_item ADD returned_to_stock INT(10); "); $installer->endSetup(); ?>
The second one has to add an attribute to the item so that I can use methods like setReturnToStock(value)
<?php $installer = Mage::getResourceModel('sales/setup', 'sales_setup'); $installer->startSetup(); $installer->addAttribute('creditmemo_item', 'returned_to_stock', array('type' => 'int', 'grid' => true)); $installer->endSetup(); ?>
The SQL runs just fine, the second script also runs without errors, but when I log a memo item the new field is not there. So I am guessing it doesn't work.
How do I check:
1)The correct syntax for the addAttribute('creditmemo_item'
2)If the attribute has been added or if it didn't work to be 100% sure