OCA reporting engine fork for dev and update.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
776 B

4 years ago
4 years ago
4 years ago
4 years ago
  1. # Copyright 2015-2019 Onestein (<https://www.onestein.eu>)
  2. # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
  3. def uninstall_hook(cr, registry):
  4. # delete dirty data that could cause problems
  5. # while re-installing the module
  6. cr.execute(
  7. """
  8. delete from ir_model where model like 'x_bve.%'
  9. """
  10. )
  11. cr.execute(
  12. """
  13. delete from bve_view where model_name like 'x_bve.%'
  14. """
  15. )
  16. cr.execute(
  17. """
  18. SELECT 'DROP VIEW ' || table_name
  19. FROM information_schema.views
  20. WHERE table_schema NOT IN ('pg_catalog', 'information_schema')
  21. AND table_name like 'x_bve_%'
  22. """
  23. )
  24. results = list(cr.fetchall())
  25. for result in results:
  26. cr.execute(result[0])