Problem; once the employee Payslip is Completed it cannot be deleted.
There is no evident way to do this, the way I found was to change the status to 'draft' in the database so that the system will allow me to delete them; this is not a very safe way of doing this because it can easily break the system.
One workaround is:
- connect to your server
- change into postgres user sudo su - postgres
- open psql terminal with your database (psql [database name])
- write sql command:
update hr_payslip set state = 'draft';
that sets all the existing payslips into draft after that you can delete them. If you don't want to set all the payslips into draft you can add there condition:
where id=[id of the payslip you want to set into draft]
This condition has to be put before semicolon (";").