summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/widgets
diff options
context:
space:
mode:
authorPierre Masereel <pim@odoo.com>2017-04-14 13:30:04 +0200
committerPierre Masereel <pim@odoo.com>2017-04-18 13:14:50 +0200
commit2b22ceea6fd5f1e8e999235bcf5f3d3e15206710 (patch)
tree5f1a4466230989179114338050a47d0e700a0b34 /addons/web/static/src/js/widgets
parenta055d5f2266e2a8490808474639814ccf8bc9c54 (diff)
[FIX] web: date_picker empty input field
When you try to empty a date or datetime field, you get a traceback saying that 'clone' and 'isSame' are not functions. This error occurs when you empty the field because the value is 'false' and you cannot call 'clone' or 'isSame' on false. To fix this, we ensure that value is not false before calling these methods on it. This bug has been introduced in rev: https://github.com/odoo/odoo/commit/c32724eae06c987e74a0600f1669696e499edc33
Diffstat (limited to 'addons/web/static/src/js/widgets')
-rw-r--r--addons/web/static/src/js/widgets/date_picker.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/web/static/src/js/widgets/date_picker.js b/addons/web/static/src/js/widgets/date_picker.js
index 4abab997666..1641f13f634 100644
--- a/addons/web/static/src/js/widgets/date_picker.js
+++ b/addons/web/static/src/js/widgets/date_picker.js
@@ -60,7 +60,7 @@ var DateWidget = Widget.extend({
}
},
get_value: function() {
- return this.get('value').clone();
+ return this.get('value') && this.get('value').clone();
},
set_value_from_ui: function() {
var value = this.$input.val() || false;