diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml index a2067d54b60..f4237945866 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -173,13 +173,15 @@ +
- - + + +
Manager
@@ -200,14 +202,14 @@ -
- - - + + + - - () - + + + +
diff --git a/addons/project/static/src/img/bug.png b/addons/project/static/src/img/bug.png new file mode 100644 index 00000000000..a18278ff5c4 Binary files /dev/null and b/addons/project/static/src/img/bug.png differ diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index a69a944675c..ec7b15881a6 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -487,12 +487,59 @@ project_issue() class project(osv.osv): _inherit = "project.project" + + def _compute_issue(self, cr, uid, ids, field_name, arg, context=None): + res={} + issue_pool=self.pool.get('project.issue') + for project in self.browse(cr, uid, ids, context=context): + issues = issue_pool.search(cr, uid, [('project_id','=',project.id)]) + res[project.id] = len(issues) + return res + _columns = { 'project_escalation_id' : fields.many2one('project.project','Project Escalation', help='If any issue is escalated from the current Project, it will be listed under the project selected here.', states={'close':[('readonly',True)], 'cancelled':[('readonly',True)]}), 'reply_to' : fields.char('Reply-To Email Address', size=256), - 'issues' : fields.boolean('Issues',help = "If you check this field issues are appears in kanban view") + 'issues' : fields.boolean('Issues',help = "If you check this field issues are appears in kanban view"), + 'open_issues': fields.function(_compute_issue , store=True,type='integer',string="Issue"), } + def open_issues(self, cr, uid, ids, context=None): + #Open the View for the Tasks for the project + """ + This opens Issues views + @return :Dictionary value for issue view + """ + if context is None: + context = {} + value = {} + data_obj = self.pool.get('ir.model.data') + for project in self.browse(cr, uid, ids, context=context): + # Get Task views + tree_view = data_obj.get_object_reference(cr, uid, 'project_issue', 'project_issue_tree_view') + form_view = data_obj.get_object_reference(cr, uid, 'project_issue', 'project_issue_form_view') + calander_view = data_obj.get_object_reference(cr, uid, 'project_issue', 'project_issue_calendar_view') + search_view = data_obj.get_object_reference(cr, uid, 'project_issue', 'view_project_issue_filter') + kanban_view = data_obj.get_object_reference(cr, uid, 'project_issue', 'project_issue_kanban_view') + context.update({ + #'search_default_user_id': uid, + 'search_default_project_id':project.id + }) + value = { + 'name': _('Issue'), + 'context': context, + 'view_type': 'form', + 'view_mode': 'form,tree', + 'res_model': 'project.issue', + 'view_id': False, + 'domain':[('project_id','in',ids)], + 'context': context, + 'views': [(kanban_view and kanban_view[1] or False, 'kanban'),(tree_view and tree_view[1] or False, 'tree'),(calander_view and calander_view[1] or False, 'calendar'),(form_view and form_view[1] or False, 'form')], + 'type': 'ir.actions.act_window', + 'search_view_id': search_view and search_view[1] or False, + 'nodestroy': True + } + return value + def _check_escalation(self, cr, uid, ids, context=None): project_obj = self.browse(cr, uid, ids[0], context=context) if project_obj.project_escalation_id: diff --git a/addons/project_issue/project_issue_menu.xml b/addons/project_issue/project_issue_menu.xml index 086a0c43de3..5023891f6ba 100644 --- a/addons/project_issue/project_issue_menu.xml +++ b/addons/project_issue/project_issue_menu.xml @@ -53,7 +53,7 @@ view_mode="tree,form,calendar,graph" view_type="form"/> - diff --git a/addons/project_issue/project_issue_view.xml b/addons/project_issue/project_issue_view.xml index fb3aba69f66..a1b3bf19782 100644 --- a/addons/project_issue/project_issue_view.xml +++ b/addons/project_issue/project_issue_view.xml @@ -380,5 +380,22 @@ + + project.project.kanban.inherited + project.project + kanban + + + + + + + + + + + + + diff --git a/addons/project_long_term/project_long_term.py b/addons/project_long_term/project_long_term.py index d54072f1cc7..b92449699a8 100644 --- a/addons/project_long_term/project_long_term.py +++ b/addons/project_long_term/project_long_term.py @@ -226,7 +226,7 @@ class project(osv.osv): _columns = { 'phase_ids': fields.one2many('project.phase', 'project_id', "Project Phases"), - 'phase' : fields.boolean('Phase',help = "If you check this field Phases are appears in kanban view"), + 'phases' : fields.boolean('Phase',help = "If you check this field Phases are appears in kanban view"), 'open_phases' : fields.function(_open_phase , type='integer',string="Open Phases"), } @@ -267,6 +267,7 @@ class project(osv.osv): 'nodestroy': True } return value + def schedule_phases(self, cr, uid, ids, context=None): context = context or {} if type(ids) in (long, int,): diff --git a/addons/project_long_term/project_long_term_view.xml b/addons/project_long_term/project_long_term_view.xml index fe91c4c54ea..12245814240 100644 --- a/addons/project_long_term/project_long_term_view.xml +++ b/addons/project_long_term/project_long_term_view.xml @@ -105,7 +105,7 @@ - + @@ -116,10 +116,13 @@ kanban - - - () - + + + + + + +