[IMP] async require of raphael.js
[odoo/odoo.git] / addons / web_diagram / static / src / js / diagram.js
index 77876c9..34dc5e0 100644 (file)
@@ -24,6 +24,15 @@ instance.web.DiagramView = instance.web.View.extend({
         this.ids = this.dataset.ids;
         this.on('pager_action_executed', self, self.pager_action_trigger);
     },
+    start: function () {
+        return this._super().then(function () {
+            return $.when(
+                openerp.webclient.session.load_js(['/web/js/web_diagram.assets_raphael'])
+            );
+        }).fail(function () {
+            throw new Error("Could not load raphael.js");
+        });
+    },
 
     view_loading: function(r) {
         return this.load_diagram(r);