Invoice is not marked as unpaid
Steps to reproduce:
- Create the invoice with a user that has no employee and post it. This results in a invoice with a posted_by employee set as empty
- Pay the invoice
- Set an employee to the user (or use a different user who has the assigned employee field set).
- Unreconcile the invoice payment
Current behaviour:
The invoice is keep as paid when it should be posted after unreconciling the lines. Clicking the process button shows the following error message: `You can not modify invoice "x" because it is posted, paid or cancel·led".
Expected behaviour:
The invoice is keep as posted after unreconciling the lines.
Note that I used the example of an user withno employee set to reproduce on a new database, but we found this problem on a database which has been upgraded to 7.0 series and this error is reproducible with any invoice that has been paid before the upgrade as the posted by field is added on the upgrade and it is empty for all records.