bzr revid: sgo@tinyerp.com-20120406082458-zd2qrvy3i9yd071o
This commit is contained in:
Sanjay Gohel (Open ERP)
2012-04-06 13:54:58 +05:30
parent 1c5d050c4e
commit e6f47e03ea
3 changed files with 20 additions and 3 deletions
+3 -1
View File
@@ -201,7 +201,9 @@ class project(osv.osv):
'task': fields.boolean('Task',help = "If you check this field tasks appears in kanban view"),
'open_task': fields.function(_open_task , type='integer',string="Open Tasks"),
}
def dummy(self, cr, uid, ids, context=None):
return False
def open_tasks(self, cr, uid, ids, context=None):
#Open the View for the Tasks for the project
"""
+1 -1
View File
@@ -200,7 +200,7 @@
</t>
</a>
</h4>
<button class="click_button" type="object">
<button class="click_button" type="object" t-att-id="record.id.value">
<table class="project_fields">
<tr id="deadline" t-if="record.date.raw_value">
<th align="left">Deadline</th>
+16 -1
View File
@@ -9,7 +9,22 @@ openerp.project = function(openerp) {
}).mouseout(function() {
return $(this).find('.oe_project_kanban_action').hide();
});
$('.click_button').attr('data-name','open_tasks');
$('.click_button').mouseover(function() {
click_button = this
var domain = [['id','=',this.getAttribute("id")]];
var dataset = new openerp.web.DataSetSearch(self, 'project.project', self.session.context, domain);
dataset.read_slice([]).then(function(result){
if(result[0].task){
click_button.setAttribute('data-name','open_tasks');
}
else
{
click_button.setAttribute('data-name','dummy');
}
});
});
_.each($('.oe_project_kanban_vignette'),function(record){
_.each(record.getElementsByTagName('img'),function(img){