openerp: reactivate employee payslip

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:

  1. connect to your server
  2. change into postgres user sudo su - postgres
  3. open psql terminal with your database (psql [database name])
  4. 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 (";").

Leave a Reply

Your email address will not be published. Required fields are marked *