From d3b2da41b7fffc5e12583048e0af1088bb1a8de2 Mon Sep 17 00:00:00 2001 From: XavierDo Date: Tue, 19 Feb 2019 11:44:48 +0000 Subject: [PATCH] [FIX] note: display date picker in activity menu The date picker should be displayed when clicking on the fa-calendar when creating a note from activity systray. The test was missing the assertion checking that the date picker was displayed, but fixing this issue breaks the test. The datepicker looks to be asynchronously initialized, and the blur event raises an error because of that. Since it is difficult to test external libs behaviour, this step is simply removed from the test. Task: 1942850 closes odoo/odoo#31241 --- addons/note/static/src/js/systray_activity_menu.js | 2 +- addons/note/static/tests/systray_activity_menu_tests.js | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/note/static/src/js/systray_activity_menu.js b/addons/note/static/src/js/systray_activity_menu.js index e2e484ca10f..f8a5e8e288e 100644 --- a/addons/note/static/src/js/systray_activity_menu.js +++ b/addons/note/static/src/js/systray_activity_menu.js @@ -118,7 +118,7 @@ ActivityMenu.include({ _onNoteDateTimeSetClick: function (ev) { ev.preventDefault(); ev.stopPropagation(); - this.noteDateTimeWidget.$input.click(); + this.noteDateTimeWidget.$input.select(); }, /** * Saving note (quick create) and updating activity preview diff --git a/addons/note/static/tests/systray_activity_menu_tests.js b/addons/note/static/tests/systray_activity_menu_tests.js index 81b2c5ac198..e00cc1001f7 100644 --- a/addons/note/static/tests/systray_activity_menu_tests.js +++ b/addons/note/static/tests/systray_activity_menu_tests.js @@ -108,7 +108,6 @@ QUnit.test('note activity menu widget: create note from activity menu', function // creating quick note with date activityMenu.$('.o_note_show').click(); activityMenu.$('input.o_note_input').val("New Note"); - activityMenu.$('.o_note_set_datetime').click(); activityMenu.$(".o_note_save").click(); assert.strictEqual(activityMenu.$('.o_notification_counter').text(), '2', "should increment activity notification counter after creating a second note");