[FIX] web: database selector and manager
The database manager and selector triggered an internal server error according to the modules installed. The issue is that some modules (like utm) overrode ir_http's dispatch and openned a cursor before calling super. Following rev[1], the database manager can tell you the incompatible databases. For that, it opens a new cursor to each database and get back the Odoo's version. After the information is fetched, the cursor is closed. Closing a cursor does not release it from the connection pool, so the database cannot be dropped and here comes the fix [2]: this commit removes all cursors to `database` from the connection pool. Now, if a module overrides the ir_http's dispatch and open a cursor before calling `super`, the automatic commit/close done at the end of a successful request cannot succeed in the database manager or selector as the cursor is closed during the call to super, leading to an internal server error. To workaround this issue, we explicitely set the cursor to None, as it will prevent the automatic commit/close at the end of the request. This is similar to rev5c6087e38e[1]96f703ff84[2]610036756a
This commit is contained in:
@@ -639,10 +639,12 @@ class Database(http.Controller):
|
||||
|
||||
@http.route('/web/database/selector', type='http', auth="none")
|
||||
def selector(self, **kw):
|
||||
request._cr = None
|
||||
return self._render_template(manage=False)
|
||||
|
||||
@http.route('/web/database/manager', type='http', auth="none")
|
||||
def manager(self, **kw):
|
||||
request._cr = None
|
||||
return self._render_template()
|
||||
|
||||
@http.route('/web/database/create', type='http', auth="none", methods=['POST'], csrf=False)
|
||||
|
||||
Reference in New Issue
Block a user