Community mailing list archives
Re: database cleanupby
I would agree with this when deleting data that relies on other tables. You would need to back track and delete any data relating to that record. Which can become complicated, depending on the specific record you want to delete.
I would do this in a few ways, if you want to push from test to live, personally I would go with having a test database and production system. Pull data from the test that you want and push into your production system. You have various ways, one I prefer is to user Odoo's own export/import options. Export your data from test and import them into product system. That way, you get the data you want and it's in good shape. You could write some code to transfer data across if you know what you are doing.
Assuming you are using VM's. The other way would to get your base data in for example, your customers, products etc. Make either a copy of the VM, or do a snapshot. Test the system by entering invoices etc. Then either revert your snapshot back to the base data setup. With that, you will have a production copy ready to use. Or use the copied VM and fire it up as a separate instance as your product version, once the test has been signed off.
Personally, I just transfer the data to the production system and also once you make some development changes on test for your users to test. You will need to make those changes in production, after being signed off. So really you need two separate systems, as taking test and just making that production every time is not going to work. Personally, once you go live, you really need three seperate systems Test/Development, UAT and production anyway. This way you can develop whilst not affecting any user testing and a production system people can work on.
A very quick and dirty email on how to do this and it's something that needs to be setup first. Because as soon as your system goes to production, I guarantee you will be making changes that requires a separate system to test in.
On 02/12/15 15:27, Ray Carnes wrote:
Changing data via SQL has a very high risk of putting your system into an inconsistent state because you bypass business logic. Odoo wasn't written to handle changes to the storage layer outside the API.
If you log SQL calls, learn the data model and do lots of testing you can attempt this, but is a very advanced topic.
There is not an easy way with one click but depending which transactions there is pretty easy to achieve a list of tables affected and clear them with an SQL.
At least the ones you mentioned:
Remember reset also the sequences.
But there is an opportunity there when we began with Odoo we look for such module but we never did it :-(
On Wednesday, 2 December 2015, Franco Ordoñez <email@example.com> wrote:
Is there some way or some module to do a database movement transactions cleanup, I mean i have configured odoo in test environment , created customers, products, have done all configuration everything is tested and successfull. to rollout to production i would like to have some option to delete invoices, whs transactions, account transactions but not delete customers, products, configuration, etc.
Hola comunidadExiste alguna manera o algun modulo el cual nos permita hacer un borrado de las transacciones de una base de datos, Ejemple he creado una base de datos de test y ahi creamos clientes, productos, configuramos y todo esta ok, ahora para pasar a produccion nos gustaria una opcion que elimine movimientos o transacciones como facturas, movimientos de bodega, contabilidad, etc. pero sin que borre los clientes, productos ni las configuraciones.
- Franco Ordonez