Make invoice reference not readonly for posted invoices

The reference field can be made editable for any state but only if the invoice report is not cached.
When the feature to refresh cache is implemented it may be good to be able to change its content during the procedure.
The reference can not be made required (for self-invoice like commission).