Browse Source

[FIX] Check if date widget properties exist

the options property of the dateWidget does not exist when the
field is rendered in for example a list view.

Check if the options and datepicker properties exist first.
pull/685/head
Stephan Rozendaal 7 years ago
parent
commit
6cb33c664b
  1. 12
      web_widget_datepicker_options/static/src/js/datepicker.js

12
web_widget_datepicker_options/static/src/js/datepicker.js

@ -30,11 +30,13 @@ odoo.define('web_widget_datepicker_options', function (require) {
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;
});
if (self.__parentedParent.options instanceof Object) {
if (self.__parentedParent.options.datepicker instanceof Object) {
var options = this.__parentedParent.options.datepicker;
$.each(options, function(value, key) {
self.options[value] = key;
});
}
}
},
});

Loading…
Cancel
Save