deisy 6 éve
szülő
commit
d24f85eb43
2 módosított fájl, 36 hozzáadás és 36 törlés
  1. 35 35
      static/src/js/project_kanban.js
  2. 1 1
      template.xml

+ 35 - 35
static/src/js/project_kanban.js

@@ -1,41 +1,41 @@
 openerp.custom_project = function(instance) {
   var QWeb = instance.web.qweb;
 
-  instance.web_calendar.CalendarView = instance.web_calendar.CalendarView.extend({
-    remove_event: function(id) {
-      var self = this;
-
-      function do_it() {
-        return $.when(self.dataset.unlink([Number(id)])).then(function() {
-          self.$calendar.fullCalendar('removeEvents', id);
-        });
-      }
-
-      if (this.options.confirm_on_delete) {
-        if (confirm(_t("Está seguro que desea eliminar esta actividad?"))) {
-          return do_it();
-        }
-      } else
-        return do_it();
-    },
-    event_data_transform: function(event) {
-      var res = this._super.apply(this, arguments);
-      //This would go off when there is no color set for hex_value. You could control this too.
-      if (res && res.hasOwnProperty('className')) {
-        //If you would uncomment the next line it would use the default colour that is set for the user. (default behaviour from Odoo calendars)
-        // res.className = res.className.substring(0, res.className.indexOf(' calendar_color_'));
-        // res.backgroundColor = '#DBDBDB';
-        if (res.title.indexOf('false') > -1) {
-          res.title = res.title.substring(0, res.title.indexOf(','));
-        }
-      }
-      if (event.hex_value && res.title) {
-        res.backgroundColor = event.hex_value;
-        res.title = res.title.substring(0, res.title.indexOf(', ' + event.hex_value));
-      }
-      return res;
-    }
-  });
+  // instance.web_calendar.CalendarView = instance.web_calendar.CalendarView.extend({
+  //   remove_event: function(id) {
+  //     var self = this;
+  //
+  //     function do_it() {
+  //       return $.when(self.dataset.unlink([Number(id)])).then(function() {
+  //         self.$calendar.fullCalendar('removeEvents', id);
+  //       });
+  //     }
+  //
+  //     if (this.options.confirm_on_delete) {
+  //       if (confirm(_t("Está seguro que desea eliminar esta actividad?"))) {
+  //         return do_it();
+  //       }
+  //     } else
+  //       return do_it();
+  //   },
+  //   event_data_transform: function(event) {
+  //     var res = this._super.apply(this, arguments);
+  //     //This would go off when there is no color set for hex_value. You could control this too.
+  //     if (res && res.hasOwnProperty('className')) {
+  //       //If you would uncomment the next line it would use the default colour that is set for the user. (default behaviour from Odoo calendars)
+  //       // res.className = res.className.substring(0, res.className.indexOf(' calendar_color_'));
+  //       // res.backgroundColor = '#DBDBDB';
+  //       if (res.title.indexOf('false') > -1) {
+  //         res.title = res.title.substring(0, res.title.indexOf(','));
+  //       }
+  //     }
+  //     if (event.hex_value && res.title) {
+  //       res.backgroundColor = event.hex_value;
+  //       res.title = res.title.substring(0, res.title.indexOf(', ' + event.hex_value));
+  //     }
+  //     return res;
+  //   }
+  // });
 
   instance.web_kanban.KanbanRecord = instance.web_kanban.KanbanRecord.extend({
     on_card_clicked: function() {

+ 1 - 1
template.xml

@@ -5,7 +5,7 @@
               <xpath expr="." position="inside">
                   <link rel="stylesheet" href="/custom_project/static/src/css/custom.css"/>
 
-                  <!-- <script type="text/javascript" src="/custom_project/static/src/js/project_kanban.js"></script> -->
+                  <script type="text/javascript" src="/custom_project/static/src/js/project_kanban.js"></script>
               </xpath>
         </template>