From 3feb93e4afc357cc2e748fc8c2da6058b8e9d7b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 28 Dec 2019 17:50:36 +0100 Subject: [PATCH] Do not set current moment when opening the picker Otherwise this trigger a display before the focus out of the previously focused widget. Such that the previous widget may loose its data. So we prevent datetimepicker to set a moment and such that it behaves like tryton. issue8921 review266581003 --- src/view/form.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/view/form.js b/src/view/form.js index a7d50bcbeb..2faa9f3997 100644 --- a/src/view/form.js +++ b/src/view/form.js @@ -1403,6 +1403,7 @@ function eval_pyson(value){ this.date.datetimepicker({ 'locale': moment.locale(), 'keyBinds': null, + 'useCurrent': false, }); this.date.css('max-width', this._width); this.date.on('dp.change', this.focus_out.bind(this)); @@ -4515,6 +4516,7 @@ function eval_pyson(value){ 'format': Sao.common.moment_format(this.format), 'locale': moment.locale(), 'keyBinds': null, + 'useCurrent': false, }); this.date.on('dp.change', this.parent_widget.focus_out.bind(this.parent_widget));