Closed AlbertParera closed 3 months ago
Thanks for the heads up.
The documentation supports this bug ticket, I will implement this change later today.
On deactivation, plugins can run a routine to remove temporary data such as cache and temp files and directories.
The deactivation hook is sometimes confused with the uninstall hook. The uninstall hook is best suited to delete all data permanently such as deleting plugin options and custom tables, etc.
https://developer.wordpress.org/plugins/plugin-basics/activation-deactivation-hooks/
Every time the plugin is deactivated (for maintenance reasons for example), all data and tables from plugin database are dropped, being necessary to reconfigure all again (connection, mappings...). It's not quite user-friendly who can lost his data after deactivation. I suggest adding a new file called uninstall.php:
and remove the following code in odoo_conn.php file:
In a hypothetical case it would NOT be necessary to use
register_uninstall_hook( 'uninstall.php', 'odoo_conn_uninstall_function' );
Simply using the uninstall.php file is enough.and remove deactivation.php file too.