diff options
| author | Aaron Bohy <aab@odoo.com> | 2019-09-12 08:31:05 +0000 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2019-09-18 11:31:43 +0000 |
| commit | 34e5271d7b05a20ac7609f2bd8a2ca1561326e94 (patch) | |
| tree | 7fd11b465158e11be9021e696c14cc8fb2a709ec /addons/web/static/src/js/fields/basic_fields.js | |
| parent | 38e7f6f95b54504d3f2b3d572351daead1fdd3d8 (diff) | |
[FIX] web: list: multi edit input of date(time) fields
The Date(Time)Fields listen to 'input' and 'change' events (like
all InputFields) to keep track of changes. However, the datepicker
already listens to the 'change' event. As a consequence, in multi
edition in a list view, if the user changed the value of a
date(time) field by directly editing the input, the fieldChanged
event was triggered twice, and there were 2 dialogs asking the user
if he wanted to save the change.
This rev. makes the Date(Time)Fields stop listening themselves to
'input' and 'change' events, and instead completely rely on the
datepicker widget.
Task 2068280
Diffstat (limited to 'addons/web/static/src/js/fields/basic_fields.js')
| -rw-r--r-- | addons/web/static/src/js/fields/basic_fields.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js index da46488cffa..3dc90ea6afe 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -684,6 +684,9 @@ var FieldDate = InputField.extend({ className: "o_field_date", tagName: "span", supportedFieldTypes: ['date', 'datetime'], + // we don't need to listen on 'input' nor 'change' events because the + // datepicker widget is already listening, and will correctly notify changes + events: AbstractField.prototype.events, /** * @override |
