When a call to init_models() fails, the post-init queue still contains callables that refer to a soon-to-be-closed cursor. If one calls init_models() in another request, the post-init process will inevitably fail because it refers to closed cursors. closes odoo/odoo#40379 X-original-commit: 33f87ffebaa1cb38e3ce8ce44c8b8b538b49e5b9 Signed-off-by: Raphael Collet (rco) <rco@openerp.com>