From 696233dfd628c15e1b714a1edca7c3843a361e72 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Fri, 1 Oct 2010 20:13:57 +0530 Subject: [PATCH 1/9] [IMP]: Project module-task menu :Project View-red for ovepassed deadline bzr revid: ron@tinyerp.com-20101001144357-lzmauail17hoytdc --- addons/project/project_view.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml index 6efc64dd494..4be52e78c1e 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -112,7 +112,7 @@ - + @@ -302,7 +302,7 @@ tree - + From fdc839079f63171745b9dc18d86035d74b6c0a2c Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Mon, 4 Oct 2010 18:40:33 +0530 Subject: [PATCH 2/9] [FIX]:Issue Menu:-Issue will be Convert Task Only when Issue in To Do State -- progressbar on issue to related with task progressbar >> Long Term Planning Menu:The Gantt View Display Phase Name ---calender view and Gantt View Display All Phases bzr revid: ron@tinyerp.com-20101004131033-czvqbsgeebo2wu0w --- addons/project/project.py | 15 ++- addons/project_issue/project_issue.py | 95 +++++++++++-------- .../project_long_term_view.xml | 8 +- 3 files changed, 69 insertions(+), 49 deletions(-) diff --git a/addons/project/project.py b/addons/project/project.py index 996e79a1f8b..75be42823bd 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -316,7 +316,7 @@ class project(osv.osv): if child_ids: self.setActive(cr, uid, child_ids, value, context=None) return True - + project() class users(osv.osv): @@ -523,7 +523,7 @@ class task(osv.osv): if not project_id: return False task = self.browse(cr, uid, project_id, context=context) project = task.project_id - res = self.do_close(cr, uid, [project_id], context=context) + res = self.do_close(cr, uid, [project_id], context=context) if project.warn_manager or project.warn_customer: return { 'name': _('Send Email after close task'), @@ -534,7 +534,7 @@ class task(osv.osv): 'target': 'new', 'nodestroy': True, 'context': {'active_id': task.id} - } + } return res def do_close(self, cr, uid, ids, context=None): @@ -576,6 +576,8 @@ class task(osv.osv): if context is None: context = {} request = self.pool.get('res.request') + p_issue = self.pool.get('project.issue') + for task in self.browse(cr, uid, ids, context=context): project = task.project_id if project and project.warn_manager and project.user_id.id and (project.user_id.id != uid): @@ -590,10 +592,15 @@ class task(osv.osv): }) self.write(cr, uid, [task.id], {'state': 'open'}) + issue_id=p_issue.search(cr,uid,[('task_id','=',task.id)]) + p_issue.write(cr, uid,issue_id, {'progress':0.0}) + return True def do_cancel(self, cr, uid, ids, *args): request = self.pool.get('res.request') + p_issue = self.pool.get('project.issue') + print "Cancel" tasks = self.browse(cr, uid, ids) for task in tasks: project = task.project_id @@ -609,7 +616,9 @@ class task(osv.osv): }) message = _('Task ') + " '" + task.name + "' "+ _("is Cancelled.") self.log(cr, uid, task.id, message) + issue_id=p_issue.search(cr,uid,[('task_id','=',task.id)]) self.write(cr, uid, [task.id], {'state': 'cancelled', 'remaining_hours':0.0}) + p_issue.write(cr, uid,issue_id, {'progress':100.0}) return True def do_open(self, cr, uid, ids, *args): diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index 2788b59ed7d..6496e93f2e9 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -141,7 +141,7 @@ class project_issue(crm.crm_case, osv.osv): else: res[issue.id][field] = abs(float(duration)) return res - + _columns = { 'id': fields.integer('ID'), 'name': fields.char('Name', size=128, required=True), @@ -220,48 +220,59 @@ class project_issue(crm.crm_case, osv.osv): data_obj = self.pool.get('ir.model.data') task_obj = self.pool.get('project.task') - if context is None: - context = {} - result = data_obj._get_id(cr, uid, 'project', 'view_task_search_form') - res = data_obj.read(cr, uid, result, ['res_id']) - id2 = data_obj._get_id(cr, uid, 'project', 'view_task_form2') - id3 = data_obj._get_id(cr, uid, 'project', 'view_task_tree2') - if id2: - id2 = data_obj.browse(cr, uid, id2, context=context).res_id - if id3: - id3 = data_obj.browse(cr, uid, id3, context=context).res_id + for curr_task in case_obj.browse(cr, uid,ids): + if curr_task.state in ['open']: + if context is None: + context = {} + result = data_obj._get_id(cr, uid, 'project', 'view_task_search_form') + res = data_obj.read(cr, uid, result, ['res_id']) + id2 = data_obj._get_id(cr, uid, 'project', 'view_task_form2') + id3 = data_obj._get_id(cr, uid, 'project', 'view_task_tree2') + if id2: + id2 = data_obj.browse(cr, uid, id2, context=context).res_id + if id3: + id3 = data_obj.browse(cr, uid, id3, context=context).res_id - for bug in case_obj.browse(cr, uid, ids, context=context): - new_task_id = task_obj.create(cr, uid, { - 'name': bug.name, - 'partner_id': bug.partner_id.id, - 'description':bug.description, - 'date': bug.date, - 'project_id': bug.project_id.id, - 'priority': bug.priority, - 'user_id': bug.assigned_to.id, - 'planned_hours': 0.0, - }) + for bug in case_obj.browse(cr, uid, ids, context=context): + new_task_id = task_obj.create(cr, uid, { + 'name': bug.name, + 'partner_id': bug.partner_id.id, + 'description':bug.description, + 'date': bug.date, + 'project_id': bug.project_id.id, + 'priority': bug.priority, + 'user_id': bug.assigned_to.id, + 'planned_hours': 0.0, + }) - vals = { - 'task_id': new_task_id, - 'state':'open' - } - case_obj.write(cr, uid, [bug.id], vals) + vals = { + 'task_id': new_task_id, + 'state':'open' + } + case_obj.write(cr, uid, [bug.id], vals) + + return { + 'name': _('Tasks'), + 'view_type': 'form', + 'view_mode': 'form,tree', + 'res_model': 'project.task', + 'res_id': int(new_task_id), + 'view_id': False, + 'views': [(id2,'form'),(id3,'tree'),(False,'calendar'),(False,'graph')], + 'type': 'ir.actions.act_window', + 'search_view_id': res['res_id'], + 'nodestroy': True + } + elif curr_task.state in ['done', 'cancel']: + raise osv.except_osv(_("Warning !"), _("Closed/Cancelled \ +Issue Could not convert into Task")) + return True + else: + raise osv.except_osv(_("Warning !"), _("Issue should be in \ +\'To Do\' state before converting to Task.")) + return True - return { - 'name': _('Tasks'), - 'view_type': 'form', - 'view_mode': 'form,tree', - 'res_model': 'project.task', - 'res_id': int(new_task_id), - 'view_id': False, - 'views': [(id2,'form'),(id3,'tree'),(False,'calendar'),(False,'graph')], - 'type': 'ir.actions.act_window', - 'search_view_id': res['res_id'], - 'nodestroy': True - } def _convert(self, cr, uid, ids, xml_id, context=None): data_obj = self.pool.get('ir.model.data') @@ -288,11 +299,11 @@ class project_issue(crm.crm_case, osv.osv): if not stage.on_change: return {'value':{}} return {'value':{}} - + def onchange_task_id(self, cr, uid, ids, task_id, context=None): if context is None: context = {} - result = {} + result = {} if not task_id: return {'value':{}} task = self.pool.get('project.task').browse(cr, uid, task_id, context) @@ -442,7 +453,7 @@ class project_issue(crm.crm_case, osv.osv): @param **args: Return Dictionary of Keyword Value """ return True - + def copy(self, cr, uid, id, default=None, context=None): if not context: context={} diff --git a/addons/project_long_term/project_long_term_view.xml b/addons/project_long_term/project_long_term_view.xml index 3412ba7ca08..c7122726f75 100644 --- a/addons/project_long_term/project_long_term_view.xml +++ b/addons/project_long_term/project_long_term_view.xml @@ -15,7 +15,7 @@ - + @@ -326,7 +326,7 @@ # ------------------------------------------------------ # Project Task # ------------------------------------------------------ - + phase.task.form2 project.task @@ -348,8 +348,8 @@ - - + + Date: Tue, 5 Oct 2010 13:01:06 +0530 Subject: [PATCH 3/9] [ADD]:Project->Time Tracking->Add Partner Invoices Menu bzr revid: ron@tinyerp.com-20101005073106-4x1lvc7kcaztzb60 --- addons/account/account_invoice_view.xml | 19 +++++++++++++++++++ addons/hr_timesheet/hr_timesheet_view.xml | 4 ++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index 1db17ed16cf..634caa86e75 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -1,6 +1,9 @@ + + - + project.scrum.sprint.calendar project.scrum.sprint @@ -204,7 +204,7 @@ - + project.scrum.sprint.tree project.scrum.sprint @@ -357,7 +357,7 @@ - + project.scrum.meeting.calendar project.scrum.meeting @@ -369,7 +369,7 @@ - + project.scrum.meeting.tree project.scrum.meeting @@ -389,10 +389,11 @@ form
- + +