summaryrefslogtreecommitdiff
path: root/addons/note/static/src
diff options
context:
space:
mode:
authorAlexandre Kühn <aku@odoo.com>2018-08-27 10:52:53 +0200
committerAlexandre Kühn <aku@odoo.com>2018-09-20 17:19:02 +0200
commite962f2bb77d1d794c357d1cdacc0dd2c4912b850 (patch)
tree4563b6ac6724e145e153b1d7088f3b35e0a02d0b /addons/note/static/src
parent3457e037e9801a700982153746c4ef8ec35f8183 (diff)
[FIX] mail: add new note without date from activity menu
Before this commit, it was not possible to add a note from the activity menu when no datetime has been selected from the datepicker. This is due to the server-side code that requires a deadline date to be set, otherwise no note is created. Even though the placeholder of the datetime tells 'Today', no datetime was provided to the server, thus the problem mentionned above. This commit fixes the issue by ensuring that a deadline date is always provided to the server from the `/note/new` route. In particular, if no datetime has been selected, it still displays 'Today' and sets the current datetime before the RPC. Task-ID 1875668
Diffstat (limited to 'addons/note/static/src')
-rw-r--r--addons/note/static/src/js/systray_activity_menu.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/addons/note/static/src/js/systray_activity_menu.js b/addons/note/static/src/js/systray_activity_menu.js
index f65dfce244f..e2e484ca10f 100644
--- a/addons/note/static/src/js/systray_activity_menu.js
+++ b/addons/note/static/src/js/systray_activity_menu.js
@@ -36,6 +36,8 @@ ActivityMenu.include({
},
/**
* Save the note to database using datepicker date and field as note
+ * By default, when no datetime is set, it uses the current datetime.
+ *
* @private
*/
_saveNote: function () {
@@ -47,6 +49,8 @@ ActivityMenu.include({
var noteDateTime = this.noteDateTimeWidget.getValue();
if (noteDateTime) {
params = _.extend(params, {'date_deadline': noteDateTime});
+ } else {
+ params = _.extend(params, {'date_deadline': moment()});
}
this.$('.o_note_show').removeClass('d-none');
this.$('.o_note').addClass('d-none');