[FIX] web_calendar: do not generate invalid domain if views does not specify a "date_stop" field
lp bug: https://launchpad.net/bugs/1197323 fixed bzr revid: chs@openerp.com-20130719092515-7yrvp0ifooa6rxae
This commit is contained in:
parent
03381c761d
commit
73fecedc4b
|
@ -399,11 +399,14 @@ instance.web_calendar.CalendarView = instance.web.View.extend({
|
||||||
var A = format(this.range_start.clone().addDays(-6));
|
var A = format(this.range_start.clone().addDays(-6));
|
||||||
var B = format(this.range_stop.clone().addDays(6));
|
var B = format(this.range_stop.clone().addDays(6));
|
||||||
var domain = [
|
var domain = [
|
||||||
'|', '|',
|
'&', [this.date_start, '>=', A], [this.date_start, '<=', B]
|
||||||
'&', [this.date_start, '>=', A], [this.date_start, '<=', B],
|
|
||||||
'&', [this.date_stop, '>=', A], [this.date_stop, '<=', B],
|
|
||||||
'&', [this.date_start, '<', A], [this.date_stop, '>', B]
|
|
||||||
];
|
];
|
||||||
|
if (this.date_stop) {
|
||||||
|
domain.push(
|
||||||
|
'&', [this.date_stop, '>=', A], [this.date_stop, '<=', B],
|
||||||
|
'&', [this.date_start, '<', A], [this.date_stop, '>', B]);
|
||||||
|
domain.unshift("|", "|");
|
||||||
|
}
|
||||||
domain.concat(this.last_search[0].slice(0))
|
domain.concat(this.last_search[0].slice(0))
|
||||||
return domain;
|
return domain;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue