Skip to content

Commit

Permalink
[FIX]web: Date in datepicker not comes selected by default when datep…
Browse files Browse the repository at this point in the history
…icker is opened first time when date is set through onchange, it is because datepicker was not updating, bootstrap datetimepicker provides viewDate method to update the picker
  • Loading branch information
msh-odoo committed Jul 20, 2017
1 parent 6a61921 commit 7e1a281
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions addons/web/static/src/js/widgets/date_picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ var DateWidget = Widget.extend({
},
set_value_from_ui: function() {
var value = this.$input.val() || false;
var previous_val = this.get('value');
this.set_value(this.parse_client(value));
if (this.picker && value !== previous_val) {
this.picker.viewDate(value);
}
},
set_readonly: function(readonly) {
this.readonly = readonly;
Expand Down

0 comments on commit 7e1a281

Please sign in to comment.