I need to execute some actions when the Order Invoice is created, so I've made an Observer and I've attached it to 'sales_order_invoice_save_after' event.
The problem is that my Observer function is called when the Invoice is made but also when Comments are added to the Invoice.
How could I check for that, so I could execute my actions only when the Invoice is made?
isObjectNew
on the invoice in the observer to determine if it is the first save before executing your logic? Not positive, but I think this should work, so you might give it a shot.$invoice->setData('_only_once', true)
and the second time check if it is set... Works for me every time