bzr revid: sgo@tinyerp.com-20120406122307-iqdyfnqsyljy17rs
This commit is contained in:
Sanjay Gohel (Open ERP) 2012-04-06 17:53:07 +05:30
parent c811ff3af5
commit 36a433ddcd
3 changed files with 13 additions and 6 deletions

View 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');
};

View 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');

View 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');
};
}
});