← Back to team overview

savoirfairelinux-openerp team mailing list archive

[Merge] lp:~savoirfairelinux-openerp/openerp-web/7.0-fix-1197323 into lp:openerp-web/7.0

 

Maxime Chambreuil (http://www.savoirfairelinux.com) has proposed merging lp:~savoirfairelinux-openerp/openerp-web/7.0-fix-1197323 into lp:openerp-web/7.0.

Requested reviews:
  OpenERP Core Team (openerp)
Related bugs:
  Bug #1197323 in OpenERP Web: "[trunk/7.0]Can't able to switch on calendar view"
  https://bugs.launchpad.net/openerp-web/+bug/1197323

For more details, see:
https://code.launchpad.net/~savoirfairelinux-openerp/openerp-web/7.0-fix-1197323/+merge/175400

[FIX] Calendar view by backporting the fix from trunk
-- 
https://code.launchpad.net/~savoirfairelinux-openerp/openerp-web/7.0-fix-1197323/+merge/175400
Your team Savoir-faire Linux' OpenERP is subscribed to branch lp:~savoirfairelinux-openerp/openerp-web/7.0-fix-1197323.
=== modified file 'addons/web_calendar/static/src/js/calendar.js'
--- addons/web_calendar/static/src/js/calendar.js	2013-06-28 09:07:06 +0000
+++ addons/web_calendar/static/src/js/calendar.js	2013-07-17 20:47:24 +0000
@@ -399,11 +399,14 @@
         var A = format(this.range_start.clone().addDays(-6));
         var B = format(this.range_stop.clone().addDays(6));
         var domain = [
-            '|', '|',
-            '&', [this.date_start, '>=', A], [this.date_start, '<=', B],
+            '&', [this.date_start, '>=', A], [this.date_start, '<=', B]
+        ];
+        if (this.date_stop) {
+            domain.push(
             '&', [this.date_stop, '>=', A], [this.date_stop, '<=', B],
-            '&', [this.date_start, '<', A], [this.date_stop, '>', B]
-        ];
+            '&', [this.date_start, '<', A], [this.date_stop, '>', B]);
+            domain.unshift("|", "|");
+        }
         domain.concat(this.last_search[0].slice(0))
         return domain;
     },