I installed openerp and tested it with dummy records. Now, I need to delete all these dummy records so that i can start anew with real records. Do u guys know a way to delete these records. The database on the back is postgresql
-
This should ans your question http://stackoverflow.com/questions/3327312/drop-all-tables-in-postgresql – Ankur Gupta Apr 11 '12 at 10:24
-
i cannot drop all data in the database because what if openerp is saving configuration data in the database – Noor Apr 11 '12 at 10:26
-
1The above comment also shows you how to drop a give table only and not all in the database ... – Ankur Gupta Apr 11 '12 at 11:19
-
dont you have a postgresql go there and just truncate all the table or make new db with same name and enjoy – Abhishek Mehta May 07 '12 at 13:29
-
all configurations are stored in db, so do think truncate all the table is a wise decision? – Hussain KMR Behestee Jun 26 '13 at 11:34
-
Possible duplicate of [SQL Delete Query](http://stackoverflow.com/questions/2998128/sql-delete-query) – Bonatti Oct 22 '15 at 10:17
3 Answers
Risky idea aside, you can use the truncate command and cascade it over a few core tables to not lose configurations as well as dummy data.
TRUNCATE sale_order CASCADE;
TRUNCATE purchase_order CASCADE;
TRUNCATE mrp_production CASCADE;
TRUNCATE stock_picking CASCADE;
TRUNCATE stock_tracking CASCADE;
TRUNCATE account_invoice CASCADE;
TRUNCATE account_move CASCADE;
TRUNCATE account_voucher CASCADE;
TRUNCATE wkf_instance CASCADE;
TRUNCATE ir_attachment CASCADE;
This should keep intact your chart of accounts, user logins, products, contacts/partners, and so on. Also very important to truncate all workflow instances!
Note: This will delete minimum stock reorder points on OpenERP 6.1. Unsure about where other unintended side effects may be.

- 161
- 2
- 5
-
very usefull , thank you;
note :in the openerp5 no table : account_voucher. and I truncate other tables. – Mimouni Mar 05 '14 at 16:54 -
I think it's less risky to start a new database and fix its configuration than it is to try and clean out the dummy records you created.
Here's how I would proceed in your situation:
- Create a new database without test data.
- Go through the basic configuration wizard.
- Save a clean backup without any dummy records in it.
- Create a few sales orders, purchase orders, whatever, and see which configuration settings you forgot to change.
- Restore the latest clean backup.
- If you need to change some settings, do so and go back to step 3. Otherwise, you're done.
If you want to get really fancy, you can create a customization module that makes all the configuration changes for you. That way if you really screw up a database or lose your backups, you can start from scratch again.

- 53,582
- 27
- 205
- 286
i too think that creating a new dayabase is the best option for you to remove yor dummy records and install new records.Also there is an option to uninstall
the modules you have installed in the following menu.
administration->modules->modules
select the module you want to uninstall-> hit the uninstall button ->apply sheduled upgrades
.
but the bad phase is most of the modules have dependencies to each other so they show rejection to uninstall
.

- 6,487
- 4
- 40
- 63

- 3,308
- 4
- 33
- 51