From 2d6dc75a2cb5fa81189920d0f7fdc7b7f12132ab Mon Sep 17 00:00:00 2001 From: fja-odoo Date: Thu, 25 Jul 2019 08:20:59 +0000 Subject: [FIX] web, *: make crash_manager use services correctly * = website_forum, stock Fix for: https://github.com/odoo/odoo/pull/32132 crash_manager.js was using the services while bypassing ServiceProviderMixin That means all services are duplicated, each having their own state. To fix this issue, CrashManager now extends AbstractService. Also crash_manager is now registered in serviceRegistry instead of being instanciated on the fly. The crash_manager now being a Service raise one issue with the tests: The services are not run for the tests but some tests needs the crash_manager 'unhandledrejection' listener. For that matter the services are reenable in qunit. Also the crash_manager's 'unhandledrejection' listener has to have precedence over the qunit listener as it will handle rejections wich have no reason or are not Errors. Part of: https://github.com/odoo/odoo/pull/35209 --- addons/web/static/src/js/widgets/data_export.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'addons/web/static/src/js/widgets/data_export.js') diff --git a/addons/web/static/src/js/widgets/data_export.js b/addons/web/static/src/js/widgets/data_export.js index 6903e7fea33..9031dd43232 100644 --- a/addons/web/static/src/js/widgets/data_export.js +++ b/addons/web/static/src/js/widgets/data_export.js @@ -3,7 +3,6 @@ odoo.define('web.DataExport', function (require) { var config = require('web.config'); var core = require('web.core'); -var crash_manager = require('web.crash_manager'); var Dialog = require('web.Dialog'); var data = require('web.data'); var framework = require('web.framework'); @@ -168,7 +167,7 @@ var DataExport = Dialog.extend({ }) }, complete: framework.unblockUI, - error: crash_manager.rpc_error.bind(crash_manager), + error: () => this.call('crash_manager', 'rpc_error', ...arguments), }); }, /** -- cgit v1.2.3