diff --git a/addons/project/project.py b/addons/project/project.py index 826cc43c780..a25e55d12e5 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -154,14 +154,14 @@ class project(osv.osv): if proj.tasks: raise osv.except_osv(_('Operation Not Permitted !'), _('You cannot delete a project containing tasks. I suggest you to desactivate it.')) return super(project, self).unlink(cr, uid, ids, *args, **kwargs) - + def _task_count(self, cr, uid, ids, field_name, arg, context=None): res = dict.fromkeys(ids, 0) task_ids = self.pool.get('project.task').search(cr, uid, [('project_id', 'in', ids)]) for task in self.pool.get('project.task').browse(cr, uid, task_ids, context): res[task.project_id.id] += 1 return res - + _columns = { 'complete_name': fields.function(_complete_name, string="Project Name", type='char', size=250), 'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the project without removing it."), @@ -198,14 +198,14 @@ class project(osv.osv): 'warn_header': fields.text('Mail Header', help="Header added at the beginning of the email for the warning message sent to the customer when a task is closed.", states={'close':[('readonly',True)], 'cancelled':[('readonly',True)]}), 'warn_footer': fields.text('Mail Footer', help="Footer added at the beginning of the email for the warning message sent to the customer when a task is closed.", states={'close':[('readonly',True)], 'cancelled':[('readonly',True)]}), 'type_ids': fields.many2many('project.task.type', 'project_task_type_rel', 'project_id', 'type_id', 'Tasks Stages', states={'close':[('readonly',True)], 'cancelled':[('readonly',True)]}), - 'use_tasks': fields.boolean('Task',help = "If you check this field tasks appears in kanban view"), - 'task_count': fields.function(_task_count , type='integer',string="Open Tasks"), + 'use_tasks': fields.boolean('Use Tasks', help="Check this field if this project is aimed at managing tasks"), + 'task_count': fields.function(_task_count, type='integer', string="Open Tasks"), 'color': fields.integer('Color Index'), 'company_uom_id': fields.related('company_id', 'project_time_mode_id', type='many2one', relation='product.uom'), } - def dummy(self, cr, uid,ids, context): - return False + def dummy(self, cr, uid, ids, context): + return True def _get_type_common(self, cr, uid, context): ids = self.pool.get('project.task.type').search(cr, uid, [('project_default','=',1)], context=context) @@ -217,7 +217,7 @@ class project(osv.osv): 'priority': 1, 'sequence': 10, 'type_ids': _get_type_common, - 'use_tasks' : True, + 'use_tasks': True, } # TODO: Why not using a SQL contraints ? diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml index 1e8b6ce77bc..19a1d0d4454 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -207,12 +207,12 @@