From 1dbb555aab8910d1739783c39fd502c4a2e145d0 Mon Sep 17 00:00:00 2001 From: ThanhDodeurOdoo Date: Wed, 10 Oct 2018 10:06:20 +0000 Subject: [PATCH] [FIX] document: JS feature disabled Reason: This feature currently has unfixed bugs, does an unnecessary RPC and was functionally replaced by a button inside the chatter in commit 7f97c9f and the menu inside the debug manager in commit d12b88315. This commit disables the JS part of the document module to prepare for the complete removal of the whole module and the MOV of the indexation to base. Closes #27613 --- addons/document/static/src/js/document.js | 5 +++++ addons/document/static/tests/document_tests.js | 5 +++++ addons/web/static/tests/views/form_tests.js | 10 ++-------- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/addons/document/static/src/js/document.js b/addons/document/static/src/js/document.js index b8437d70417..0461f67255a 100644 --- a/addons/document/static/src/js/document.js +++ b/addons/document/static/src/js/document.js @@ -1,5 +1,10 @@ odoo.define('document.document', function (require) { "use strict"; +/** + * The feature is disabled as it was replaced by another feature + * while still holding unfixed bugs and doing unnecessary rpc. + */ +return; var core = require('web.core'); var Dialog = require('web.Dialog'); diff --git a/addons/document/static/tests/document_tests.js b/addons/document/static/tests/document_tests.js index 96c699c041b..0e2c0038a71 100644 --- a/addons/document/static/tests/document_tests.js +++ b/addons/document/static/tests/document_tests.js @@ -1,5 +1,10 @@ odoo.define('document.tests', function (require) { "use strict"; + /** + * The feature tested here is disabled as it was replaced by another feature + * while still holding unfixed bugs and doing unnecessary rpc. + */ + return; var testUtils = require('web.test_utils'); var FormView = require('web.FormView'); diff --git a/addons/web/static/tests/views/form_tests.js b/addons/web/static/tests/views/form_tests.js index 20f62212252..40b62162ddd 100644 --- a/addons/web/static/tests/views/form_tests.js +++ b/addons/web/static/tests/views/form_tests.js @@ -5001,14 +5001,8 @@ QUnit.module('Views', { // if not only 2 dropdowns are displayed. var $dropdowns = $('.o_web_client .o_control_panel .btn-group .o_dropdown_toggler_btn'); var $actions = $('.o_web_client .o_control_panel .btn-group .dropdown-menu')[1].children; - if ('document.document' in odoo.__DEBUG__.services) { - assert.strictEqual($dropdowns.length, 3, - "there should be 3 dropdowns (print, attachment, action) in the toolbar."); - $actions = $('.o_web_client .o_control_panel .btn-group .dropdown-menu')[2].children; - } else { - assert.strictEqual($dropdowns.length, 2, - "there should be 2 dropdowns (print, action) in the toolbar."); - } + assert.strictEqual($dropdowns.length, 2, + "there should be 2 dropdowns (print, action) in the toolbar."); assert.strictEqual($actions.length, 3, "there should be 3 actions"); var $customAction = $('.o_web_client .o_control_panel .btn-group .dropdown-menu:last .dropdown-item:nth(2)');