summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/widgets
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2015-09-23 14:34:26 +0200
committerChristophe Simonis <chs@odoo.com>2015-09-23 14:34:26 +0200
commit57168a9e90066ed6b3d274d5032a20bef342a00f (patch)
treee6af71b6199d1e4bbd808580285242ceb4afde77 /addons/web/static/src/js/widgets
parent2bbf3c516df41842302c10326fd6bcd14168a89d (diff)
parenta669433326430caab705ede8d48eecda16d3ee10 (diff)
[MERGE] forward port of branch saas-6 up to a669433
Diffstat (limited to 'addons/web/static/src/js/widgets')
-rw-r--r--addons/web/static/src/js/widgets/date_picker.js10
1 files changed, 8 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 17436831d6d..d8d2b131516 100644
--- a/addons/web/static/src/js/widgets/date_picker.js
+++ b/addons/web/static/src/js/widgets/date_picker.js
@@ -84,12 +84,18 @@ var DateTimeWidget = Widget.extend({
set_datetime_default: function(){
//when opening datetimepicker the date and time by default should be the one from
//the input field if any or the current day otherwise
- if (this.type_of_date === 'datetime') {
+ if (_.contains(['datetime', 'date'], this.type_of_date)) {
var value = moment().second(0);
if (this.$input.val().length !== 0 && this.is_valid_()){
value = this.$input.val();
}
- this.$('.oe_datepicker_main').data('DateTimePicker').setValue(value);
+ var dt = this.$('.oe_datepicker_main').data('DateTimePicker');
+ // temporarily set pickTime to true to bypass datetimepicker hiding on setValue
+ // see https://github.com/Eonasdan/bootstrap-datetimepicker/issues/603
+ var saved_picktime = dt.options.pickTime;
+ dt.options.pickTime = true;
+ dt.setValue(value);
+ dt.options.pickTime = saved_picktime;
}
},
change_datetime: function(e) {