Search code examples
postgresqlodooaccounting

delete journal entries counter data in odoo 12


I needed to move the old database with all its setting from one server to another, and then remove the accounting testing data, I was able to delete journal items, journal entries and invoices but couldn't make the counter equals zero. as shown in the picture next to the journal entries:

enter image description here

I need to setup Odoo system for the production. I don't want to make a new database as it needs a lot of data entry.


Solution

  • You need to use the REINDEX maintenance operation on your database to reset table id.

    Or you can reset the table (Journal entries) id with the following SQL query:

    ALTER SEQUENCE account_move_id_seq RESTART WITH 1;