[IMP]
authorSanjay Gohel (Open ERP) <sgo@tinyerp.com>
Fri, 6 Apr 2012 12:23:07 +0000 (17:53 +0530)
committerSanjay Gohel (Open ERP) <sgo@tinyerp.com>
Fri, 6 Apr 2012 12:23:07 +0000 (17:53 +0530)
bzr revid: sgo@tinyerp.com-20120406122307-iqdyfnqsyljy17rs

addons/project/static/src/js/project.js
addons/project_issue/static/src/js/project_issue.js
addons/project_timesheet/static/src/js/project_timesheet.js

index 38fc908..5096817 100644 (file)
@@ -16,12 +16,12 @@ openerp.project = function(openerp) {
                 //set avatar title for members.
                 _.each($(this.$element).find('.project_avatar'),function(avatar){
                     var dataset = new openerp.web.DataSetSearch(this, 'res.users', self.session.context, [['id','=',avatar.id]]);
-                        dataset.read_slice([]).then(function(result){
-                            avatar.setAttribute("title",result[0].name)
+                    dataset.read_slice([]).then(function(result){
+                    avatar.setAttribute("title",result[0].name)
                     });
                  });
                 
-                //if task is true , then open the task when clickd on the anywhere in the box.
+                //if task is true , then open the task when click on the anywhere in the box.
                 if(this.record.task.raw_value)$(this.$element).find('.click_button').attr('data-name','open_tasks');
                 if(!this.record.task.raw_value)$(this.$element).find('.click_button').attr('data-name','dummy');
             };
index 8f65f44..6678fa6 100644 (file)
@@ -3,7 +3,6 @@ openerp.project_issue = function(openerp) {
         bind_events: function() {
             self = this;
             self._super();
-            console.log(self);
             if(this.view.dataset.model == 'project.project') {
                    if(this.record.task.raw_value && this.record.issues.raw_value)$(this.$element).find('.click_button').attr('data-name','open_tasks');
                    if(!this.record.task.raw_value && this.record.issues.raw_value)$(this.$element).find('.click_button').attr('data-name','open_issues');
index 83a7083..0e7ecd0 100644 (file)
@@ -4,9 +4,17 @@ openerp.project_timesheet = function(openerp) {
             self = this;
             self._super();
             if(this.view.dataset.model == 'project.project') {
-                   if(this.record.task.raw_value && this.record.issues.raw_value && this.record.timesheets.raw_value)$(this.$element).find('.click_button').attr('data-name','open_tasks');
-                   if(!this.record.task.raw_value && !this.record.issues.raw_value && this.record.timesheets.raw_value)$(this.$element).find('.click_button').attr('data-name','open_timesheets');
+               function include(arr, obj) {
+                                   for(var i=0; i<arr.length; i++) {
+                                       if (arr[i] == obj) return true;
+                                   }
+                               }
+               if(include(this.view.fields_keys,"issues"))
+               {
+                       if(!this.record.task.raw_value && !this.record.issues.raw_value && this.record.timesheets.raw_value)$(this.$element).find('.click_button').attr('data-name','open_timesheets');
                    //if(!this.record.task.raw_value)$(this.$element).find('.click_button').attr('data-name','dummy');
+               };
+               if(this.record.task.raw_value && this.record.timesheets.raw_value)$(this.$element).find('.click_button').attr('data-name','open_tasks');
             };
         }
     });