parent
c811ff3af5
commit
36a433ddcd
|
@ -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');
|
||||
};
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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');
|
||||
};
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue