Firstly, we should not rely on anything coming from the client side to solve a server-side issue, as OpenERP is supposed to be stateless.
Secondly, calling exposing a way to close_db has major and global effects on the server, impacting all current transactions on that database, so this certainly cannot be called as soon as someone logs out.
Managing database connections is the responsibility of the server, it must not be exposed to clients, or for that matter, to addons.
Sorry, this does not seem like a valid approach.
Firstly, we should not rely on anything coming from the client side to solve a server-side issue, as OpenERP is supposed to be stateless.
Secondly, calling exposing a way to close_db has major and global effects on the server, impacting all current transactions on that database, so this certainly cannot be called as soon as someone logs out.
Managing database connections is the responsibility of the server, it must not be exposed to clients, or for that matter, to addons.