Vaibhav (OpenERP) has proposed merging 
lp:~openerp-dev/openerp-web/trunk-bug-865945-vda into lp:openerp-web.

Requested reviews:
  OpenERP R&D Web Team (openerp-dev-web)
Related bugs:
  Bug #865945 in OpenERP Web: "In Purchase orders Can't open the calendar view."
  https://bugs.launchpad.net/openerp-web/+bug/865945

For more details, see:
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-bug-865945-vda/+merge/78071

Calendar throw exception only for required 'date_start` field.
-- 
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-bug-865945-vda/+merge/78071
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openerp-web/trunk-bug-865945-vda.
=== modified file 'addons/web_calendar/static/src/js/calendar.js'
--- addons/web_calendar/static/src/js/calendar.js	2011-10-03 13:52:03 +0000
+++ addons/web_calendar/static/src/js/calendar.js	2011-10-04 09:59:34 +0000
@@ -30,7 +30,7 @@
     },
     start: function() {
         this._super();
-        this.rpc("/web/view/load", {"model": this.model, "view_id": this.view_id, "view_type":"calendar", 'toolbar': true}, this.on_loaded);
+        return this.rpc("/web/view/load", {"model": this.model, "view_id": this.view_id, "view_type":"calendar", 'toolbar': true}, this.on_loaded);
     },
     stop: function() {
         scheduler.clearAll();
@@ -54,6 +54,10 @@
         this.day_length = this.fields_view.arch.attrs.day_length || 8;
         this.color_field = this.fields_view.arch.attrs.color;
         this.fields =  this.fields_view.fields;
+        
+        if (!this.date_start) {
+            throw new Error("Calendar view has none of the following attributes : 'date_start'");
+        }
 
         //* Calendar Fields *
         this.calendar_fields.date_start = {'name': this.date_start, 'kind': this.fields[this.date_start].type};
@@ -67,9 +71,6 @@
         if (this.date_stop) {
             this.calendar_fields.date_stop = {'name': this.date_stop, 'kind': this.fields[this.date_stop].type};
         }
-        if (!this.date_delay && !this.date_stop) {
-            throw new Error("Calendar view has none of the following attributes : 'date_stop', 'date_delay'");
-        }
 
         for (var fld = 0; fld < this.fields_view.arch.children.length; fld++) {
             this.info_fields.push(this.fields_view.arch.children[fld].attrs.name);
@@ -196,7 +197,7 @@
     convert_event: function(evt) {
         var date_start = openerp.web.str_to_datetime(evt[this.date_start]),
             date_stop = this.date_stop ? openerp.web.str_to_datetime(evt[this.date_stop]) : null,
-            date_delay = evt[this.date_delay] || null,
+            date_delay = evt[this.date_delay] || 1.0,
             res_text = '',
             res_description = [];
 

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to