diff options
| author | Christophe Simonis <chs@odoo.com> | 2017-09-21 17:18:49 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2017-09-21 17:18:49 +0200 |
| commit | bf4ccb21f6c9c8bcda9c6f94d844c89296523954 (patch) | |
| tree | ddc505b2a40b8421c9555fb1670be5c17f24a893 /addons/web/static/src/js/widgets | |
| parent | 6d373b109d574009ce9cfc9b350f5ab32987dde5 (diff) | |
| parent | 88395bdb8e122c1d86dede7729c9e656ca5be8a5 (diff) | |
[MERGE] forward port branch saas-16 up to 88395bdb8e1
Diffstat (limited to 'addons/web/static/src/js/widgets')
| -rw-r--r-- | addons/web/static/src/js/widgets/date_picker.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/addons/web/static/src/js/widgets/date_picker.js b/addons/web/static/src/js/widgets/date_picker.js index 76281d9366a..b95a1c4f936 100644 --- a/addons/web/static/src/js/widgets/date_picker.js +++ b/addons/web/static/src/js/widgets/date_picker.js @@ -74,9 +74,16 @@ var DateWidget = Widget.extend({ * set datetime value */ changeDatetime: function () { - if(this.isValid()) { + if (this.isValid()) { + var oldValue = this.getValue(); this._setValueFromUi(); - this.trigger("datetime_changed"); + var newValue = this.getValue(); + + if (!oldValue !== !newValue || oldValue && newValue && !oldValue.isSame(newValue)) { + // The condition is strangely written; this is because the + // values can be false/undefined + this.trigger("datetime_changed"); + } } }, /** |
