From bf70759e14947ba40bbb088c1f15853449495001 Mon Sep 17 00:00:00 2001 From: Varun Raval Date: Thu, 23 May 2019 07:20:46 +0000 Subject: [PATCH 1/3] [FIX] website_links: fix url of the landing page in link tracker The feature was broken by #28404 which made the JS make use of the "animations" system. Currently, on the website, we have an option 'Track this page' in promote section, which will give us the URL of the landing page. However, this option is not working and shows the default placeholder provided on the input. This commit will fix the issue. From now 'Track this page' option will get the URL of the landing page and it will be shown on input rather than the default placeholder value. task-1998160 closes #33603 Signed-off-by: Quentin Smetz (qsm) --- addons/website_links/static/src/js/website_links_menu.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/addons/website_links/static/src/js/website_links_menu.js b/addons/website_links/static/src/js/website_links_menu.js index 4adf2b950af..b57a51a58d3 100644 --- a/addons/website_links/static/src/js/website_links_menu.js +++ b/addons/website_links/static/src/js/website_links_menu.js @@ -7,10 +7,10 @@ odoo.define('website_links.website_links_menu', function (require) { 'use strict'; -var sAnimations = require('website.content.snippets.animation'); +var Widget = require('web.Widget'); +var websiteNavbarData = require('website.navbar'); -sAnimations.registry.websiteLinksMenu = sAnimations.Class.extend({ - selector: '#o_website_links_share_page', +var WebsiteLinksMenu = Widget.extend({ /** * @override @@ -20,4 +20,7 @@ sAnimations.registry.websiteLinksMenu = sAnimations.Class.extend({ return this._super.apply(this, arguments); }, }); + +websiteNavbarData.websiteNavbarRegistry.add(WebsiteLinksMenu, '#o_website_links_share_page'); + }); From b016c73c895a5a103346829b7918049eac452553 Mon Sep 17 00:00:00 2001 From: RomainLibert Date: Thu, 23 May 2019 09:33:33 +0000 Subject: [PATCH 2/3] [FIX] hr_holidays: fix typo closes odoo/odoo#33606 Signed-off-by: Romain Libert (rli) --- addons/hr_holidays/views/hr_leave_views.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_holidays/views/hr_leave_views.xml b/addons/hr_holidays/views/hr_leave_views.xml index 2918b593701..fd58fd7b077 100644 --- a/addons/hr_holidays/views/hr_leave_views.xml +++ b/addons/hr_holidays/views/hr_leave_views.xml @@ -510,7 +510,7 @@ tree,kanban,form,calendar,activity { 'search_default_managed_people': 1, - 'search_default_my_team_leaves': 1 + 'search_default_my_team_leaves': 1, 'search_default_approve':1} [] From 9bcc0498c0f4c174d45c8f58ae913767cab26145 Mon Sep 17 00:00:00 2001 From: Priyanka Kakadiya Date: Fri, 19 Apr 2019 06:33:40 +0000 Subject: [PATCH 3/3] [FIX] web: add test for the fix update buttons in editable list The test for the fix in 5adb6b62d22c49261d5b1aaeb1e9f15e40c074ae can only be implemented in 12.1 because that is the version that contains the createActionManager helper Task-1967278 closes odoo/odoo#32817 Signed-off-by: VincentSchippefilt --- .../src/js/views/list/list_controller.js | 5 ++- addons/web/static/tests/views/list_tests.js | 42 +++++++++++++++++++ 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/addons/web/static/src/js/views/list/list_controller.js b/addons/web/static/src/js/views/list/list_controller.js index dfa7d272a49..c8dd6a86771 100644 --- a/addons/web/static/src/js/views/list/list_controller.js +++ b/addons/web/static/src/js/views/list/list_controller.js @@ -376,8 +376,9 @@ var ListController = BasicController.extend({ * @returns {Deferred} */ _update: function () { - this._toggleSidebar(); - return this._super.apply(this, arguments); + return this._super.apply(this, arguments) + .then(this._toggleSidebar.bind(this)) + .then(this._updateButtons.bind(this, 'readonly')); }, /** * This helper simply makes sure that the control panel buttons matches the diff --git a/addons/web/static/tests/views/list_tests.js b/addons/web/static/tests/views/list_tests.js index 18dd10c52a6..cf41de943ba 100644 --- a/addons/web/static/tests/views/list_tests.js +++ b/addons/web/static/tests/views/list_tests.js @@ -14,6 +14,7 @@ var testUtilsDom = require('web.test_utils_dom'); var widgetRegistry = require('web.widget_registry'); var Widget = require('web.Widget'); +var createActionManager = testUtils.createActionManager; var createView = testUtils.createView; QUnit.module('Views', { @@ -840,6 +841,47 @@ QUnit.module('Views', { list.destroy(); }); + QUnit.test('editable list view: check that controlpanel buttons are updating when groupby applied', function (assert) { + assert.expect(4); + + this.data.foo.fields.foo = {string: "Foo", type: "char", required:true}; + + var actionManager = createActionManager({ + actions: [{ + id: 11, + name: 'Partners Action 11', + res_model: 'foo', + type: 'ir.actions.act_window', + views: [[3, 'list']], + search_view_id: [9, 'search'], + }], + archs: { + 'foo,3,list': '', + + 'foo,9,search': ''+ + '' + + '', + }, + data: this.data, + }); + + actionManager.doAction(11); + testUtils.dom.click(actionManager.$('.o_list_button_add')); + + assert.isNotVisible(actionManager.$('.o_list_button_add'), + "create button should be invisible"); + assert.isVisible(actionManager.$('.o_list_button_save'), "save button should be visible"); + + testUtils.dom.click(actionManager.$('.o_dropdown_toggler_btn:contains("Group By")')); + testUtils.dom.click(actionManager.$('.o_group_by_menu .o_menu_item a:contains("candle")')); + + assert.isVisible(actionManager.$('.o_list_button_add'), "create button should be invisible"); + assert.isNotVisible(actionManager.$('.o_list_button_save'), + "save button should be invisible after applying groupby"); + + actionManager.destroy(); + }); + QUnit.test('selection changes are triggered correctly', function (assert) { assert.expect(8);