Browse Source

[FIX] widget does not set options on the widget

The values of the date widget of the field are not being set.
This is because the start function does not update the options,
instead they are set in the init function. inherit the init
function of the widget, and add the options here.
pull/685/head
Stephan Rozendaal 7 years ago
parent
commit
3578bfb6e1
  1. 4
      web_widget_datepicker_options/static/src/js/datepicker.js

4
web_widget_datepicker_options/static/src/js/datepicker.js

@ -43,15 +43,13 @@ odoo.define('web_widget_datepicker_options', function (require) {
});
DateWidget.include({
start: function(parent, options) {
init: function(parent, options) {
this._super.apply(this, arguments);
var self = this;
if (this.__parentedParent.options.datepicker) {
var options = this.__parentedParent.options.datepicker;
$.each(options, function(value, key) {
self.options[value] = key;
self.picker[value] = key;
self.picker.options[value] = key;
});
}
},

Loading…
Cancel
Save