2

Currently, I am facing an issue to drop database table after uninstalling module in odoo.

I have created one simple module with one model name like 'test_table'. I installed that module in odoo 11.

But, When I am trying to uninstalling that module fields are deleted from the database. But 'test_table' still exist with odoo magic fields.

Is there any solution to drop table after uninstalling module in odoo?

Mayur Jotaniya
  • 304
  • 1
  • 18

1 Answers1

1

You can Remove a table in PostGreSql.

Either use the PGAdmin gui (noramlly on PORT 5432 )

Or from the command line.

http://www.postgresqltutorial.com/postgresql-drop-table/

DROP TABLE [IF EXISTS] table_name [CASCADE | RESTRICT];

johnashu
  • 2,167
  • 4
  • 19
  • 44
  • 1
    Yes, I know that. Currently, I already did it. But I want solution. And it's very logical if you are removing the module from frontend then why table is exists in database? – Mayur Jotaniya Dec 10 '19 at 13:39
  • It may still remain in the `registry`.. You might also have to remove it from `ir_model` – johnashu Dec 10 '19 at 13:40
  • It is easy for developer. But when any use did it then? I already removed it from all occurrences. But still it is happening many times. That's why I need proper solution. – Mayur Jotaniya Dec 10 '19 at 13:42
  • Are you uninstalling the module or just removing the Model? – johnashu Dec 10 '19 at 13:43
  • 1
    I am getting issue after uninstalling module. Once module is successfully uninstalled database has all tables exists with only magic fields. Data and custom fields removed from that table. But magic fields still remains in all that tables. – Mayur Jotaniya Dec 10 '19 at 13:50