mirror of https://github.com/OCA/web.git
[FIX] web_widget_datepicker_options: Fix error when field is undefined
Currently, when a view is rendered and a date or datetime field is not defined (e.g. when designing reports), it causes a JS error. This patch fixes the above error.pull/950/head
parent
442f5b7d61
commit
ba73183d64
|
@ -3,7 +3,7 @@
|
||||||
{
|
{
|
||||||
"name": "Web widget datepicker options",
|
"name": "Web widget datepicker options",
|
||||||
"summary": "Enhance customization for datepicker widgets",
|
"summary": "Enhance customization for datepicker widgets",
|
||||||
"version": "11.0.1.0.0",
|
"version": "11.0.1.0.1",
|
||||||
"category": "Web",
|
"category": "Web",
|
||||||
"author": "Vincent Vinet, "
|
"author": "Vincent Vinet, "
|
||||||
"Odoo Community Association (OCA)",
|
"Odoo Community Association (OCA)",
|
||||||
|
|
|
@ -11,6 +11,7 @@ odoo.define('web_widget_datepicker_options.datepicker', function(require) {
|
||||||
this._super.apply(this, arguments);
|
this._super.apply(this, arguments);
|
||||||
var parent = this.getParent();
|
var parent = this.getParent();
|
||||||
if(typeof parent !== 'undefined'
|
if(typeof parent !== 'undefined'
|
||||||
|
&& typeof parent.field !== 'undefined'
|
||||||
&& parent.field.type === 'date'
|
&& parent.field.type === 'date'
|
||||||
&& parent.nodeOptions){
|
&& parent.nodeOptions){
|
||||||
var datepicker = parent.nodeOptions.datepicker;
|
var datepicker = parent.nodeOptions.datepicker;
|
||||||
|
@ -24,6 +25,7 @@ odoo.define('web_widget_datepicker_options.datepicker', function(require) {
|
||||||
this._super.apply(this, arguments);
|
this._super.apply(this, arguments);
|
||||||
var parent = this.getParent();
|
var parent = this.getParent();
|
||||||
if(typeof parent !== 'undefined'
|
if(typeof parent !== 'undefined'
|
||||||
|
&& typeof parent.field !== 'undefined'
|
||||||
&& parent.field.type === 'datetime'
|
&& parent.field.type === 'datetime'
|
||||||
&& parent.nodeOptions){
|
&& parent.nodeOptions){
|
||||||
var datepicker = parent.nodeOptions.datepicker;
|
var datepicker = parent.nodeOptions.datepicker;
|
||||||
|
|
Loading…
Reference in New Issue