From 4f66758480b6334337a30d7f5e06d55efcefb396 Mon Sep 17 00:00:00 2001 From: "pap (openerp)" Date: Wed, 14 Jul 2010 11:27:14 +0530 Subject: [PATCH 01/25] [ADD]:added yml for task delegation process bzr revid: pap@tinyerp.co.in-20100714055714-zvxircwar0gdajff --- .../project/test/test_project_delegation.yml | 185 ++++++++++++++++++ 1 file changed, 185 insertions(+) create mode 100644 addons/project/test/test_project_delegation.yml diff --git a/addons/project/test/test_project_delegation.yml b/addons/project/test/test_project_delegation.yml new file mode 100644 index 00000000000..c8c784edd62 --- /dev/null +++ b/addons/project/test/test_project_delegation.yml @@ -0,0 +1,185 @@ +- + This scenario tests the delegation process. Closing all the delegated tasks(task delegation at multiple levels) transits the parent task from pending to open state. +- + Creating a project OpenERP Documentaion +- + !record {model: project.project, id: project_project_openerpdocumentaion0}: + company_id: base.main_company + name: OpenERP Documentaion + + +- + Creating a task 'Develop book for Technical and Functional reference' +- + !record {model: project.task, id: project_task_documentation_book}: + name: Develop book for Technical and Functional reference + planned_hours: 20.0 + project_id: project_project_openerpdocumentaion0 + remaining_hours: 20.0 + state: draft + +- + Open the task +- + !python {model: project.task}: | + self.do_open(cr, uid, [ref("project_task_documentation_book")], + {"lang": "en_US", "active_model": "ir.ui.menu", "active_ids": [ref("project.menu_action_view_task")], + "tz": False, "active_id": ref("project.menu_action_view_task"), }) + +- + Creating a delegate task 'Prepare a book that gives functional overview of OpenERP' +- + !record {model: project.task, id: project_task_delegate_openerp_tutorial}: + name: Prepare a book that gives functional overview of OpenERP + planned_hours: 30.0 + project_id: project.project_project_openerpdocumentaion0 + remaining_hours: 30.0 + state: draft + +- + Open the task +- + !python {model: project.task}: | + self.do_open(cr, uid, [ref("project_task_delegate_openerp_tutorial")], + {"lang": "en_US", "active_model": "ir.ui.menu", "active_ids": [ref("project.menu_action_view_task")], + "tz": False, "active_id": ref("project.menu_action_view_task"), }) + +- + Creating a delegate task 'Prepare a technical reference for creating your modules' +- + !record {model: project.task, id: project_task_delegate_developer_book}: + name: Prepare a technical reference for creating your modules + planned_hours: 30.0 + project_id: project_project_openerpdocumentaion0 + remaining_hours: 30.0 + state: draft + +- + Open the task +- + !python {model: project.task}: | + self.do_open(cr, uid, [ref("project_task_delegate_developer_book")], + {"lang": "en_US", "active_model": "ir.ui.menu", "active_ids": [ref("project.menu_action_view_task")], + "tz": False, "active_id": ref("project.menu_action_view_task"), }) + +- + Delegate task 'Develop book for Technical and Functional reference' to these tasks and make it pending +- + !record {model: project.task, id: project_task_documentation_book}: + child_ids: + - project.project_task_delegate_openerp_tutorial + - project.project_task_delegate_developer_book + planned_hours: 20.0 + state: pending + +- + Creating a delegate task 'Prepare documentation for Module Development' +- + !record {model: project.task, id: project_task_delegate_module_develop}: + name: Prepare documentation for Module Development + planned_hours: 30.0 + project_id: project.project_project_openerpdocumentaion0 + remaining_hours: 30.0 + state: draft + + +- + Creating a delegate 'Prepare documentation for Business Process Development' +- + !record {model: project.task, id: project_task_delegate_business_process_develop}: + name: Prepare documentation for Business Process Development + planned_hours: 30.0 + project_id: project_project_openerpdocumentaion0 + remaining_hours: 30.0 + state: draft + +- + Delegate task 'Prepare a technical reference for creating your modules' to these tasks and make it pending +- + !record {model: project.task, id: project_task_delegate_developer_book}: + child_ids: + - project.project_task_delegate_module_develop + - project.project_task_delegate_business_process_develop + planned_hours: 20.0 + state: pending + +- + Open the task +- + !python {model: project.task}: | + self.do_open(cr, uid, [ref("project_task_delegate_module_develop")], + {"lang": "en_US", "active_model": "ir.ui.menu", "active_ids": [ref("project.menu_action_view_task")], + "tz": False, "active_id": ref("project.menu_action_view_task"), }) + +- + Open the task +- + !python {model: project.task}: | + self.do_open(cr, uid, [ref("project_task_delegate_business_process_develop")], + {"lang": "en_US", "active_model": "ir.ui.menu", "active_ids": [ref("project.menu_action_view_task")], + "tz": False, "active_id": ref("project.menu_action_view_task"), }) + +- + Check if 'Prepare a technical reference for creating your modules' in pending state +- + !assert {model: project.task, id: project_task_delegate_developer_book, severity: error, string: Task is in pending state}: + - state == "pending" + +- + Close the child task 'Prepare documentation for Module Development' +- + !python {model: project.task}: | + self.do_close(cr, uid, [ref("project_task_delegate_module_develop")], {"lang": "en_US", + "active_ids": [ref("project.menu_action_view_task")], "tz": False, "active_model": + "ir.ui.menu", "section_id": False, "search_default_project_id": False, "search_default_user_id": + 1, "search_default_current": 1, "mail_send": False, "active_id": ref("project.menu_action_view_task"), + }) + +- + Close the child task 'Prepare documentation for Business Process Development' +- + !python {model: project.task}: | + self.do_close(cr, uid, [ref("project_task_delegate_business_process_develop")], {"lang": "en_US", + "active_ids": [ref("project.menu_action_view_task")], "tz": False, "active_model": + "ir.ui.menu", "section_id": False, "search_default_project_id": False, "search_default_user_id": + 1, "search_default_current": 1, "mail_send": False, "active_id": ref("project.menu_action_view_task"), + }) + +- + Parent task 'Prepare a technical reference for creating your modules' task must now be in open state +- + !assert {model: project.task, id: project_task_delegate_developer_book, severity: error, string: Task is in done state}: + - state == "open" + + +- + Check if task 'Develop book for Technical and Functional reference' in pending state +- + !assert {model: project.task, id: project_task_documentation_book, severity: error, string: Task is in pending state}: + - state == "pending" + +- + Close the child project 'Prepare a technical reference for creating your modules' +- + !python {model: project.task}: | + self.do_close(cr, uid, [ref("project_task_delegate_developer_book")], {"lang": "en_US", + "active_ids": [ref("project.menu_action_view_task")], "tz": False, "active_model": + "ir.ui.menu", "section_id": False, "search_default_project_id": False, "search_default_user_id": + 1, "search_default_current": 1, "mail_send": False, "active_id": ref("project.menu_action_view_task"), + }) + +- + Close the child project 'Prepare a book that gives functional overview of OpenERP' +- + !python {model: project.task}: | + self.do_close(cr, uid, [ref("project_task_delegate_openerp_tutorial")], {"lang": "en_US", + "active_ids": [ref("project.menu_action_view_task")], "tz": False, "active_model": + "ir.ui.menu", "section_id": False, "search_default_project_id": False, "search_default_user_id": + 1, "search_default_current": 1, "mail_send": False, "active_id": ref("project.menu_action_view_task"), + }) + +- + Parent task 'Develop book for Technical and Functional reference' must be now in open state +- + !assert {model: project.task, id: project_task_documentation_book, severity: error, string: Task is in done state}: + - state == "open" \ No newline at end of file From 823933aa959eeb84e026b4f93def156565c05a4a Mon Sep 17 00:00:00 2001 From: "pap (openerp)" Date: Wed, 14 Jul 2010 15:02:24 +0530 Subject: [PATCH 02/25] [IMP]:improved demo data for project_long_term removing hard-coded dates bzr revid: pap@tinyerp.co.in-20100714093224-mcgf4lwdgd9sr1kn --- addons/project/project_view.xml | 3 +- addons/project_gtd/project_gtd_view.xml | 3 +- .../project_long_term_demo.xml | 315 +++++------------- addons/project_planning/project_planning.py | 2 +- 4 files changed, 92 insertions(+), 231 deletions(-) diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml index 8fb488478ec..0a93da537d9 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -131,7 +131,7 @@ - + @@ -534,7 +534,6 @@ - @@ -22,7 +21,6 @@
- @@ -100,5 +98,6 @@
+ diff --git a/addons/project_long_term/project_long_term_demo.xml b/addons/project_long_term/project_long_term_demo.xml index fd965e4c792..4abc9b7ef57 100644 --- a/addons/project_long_term/project_long_term_demo.xml +++ b/addons/project_long_term/project_long_term_demo.xml @@ -249,14 +249,14 @@ - 2010-02-25 + open normal Develop an OpenERP Website. - 2010-04-30 + @@ -269,14 +269,14 @@ Information Gathering and Understanding - 2010-03-11 15:37:00 - 2010-02-25 15:33:00 + + draft - + - 2010-02-24 15:37:00 - 2010-03-10 15:33:00 + + @@ -284,14 +284,14 @@ Planning - 2010-03-25 15:49:00 - 2010-02-18 15:48:00 + + draft - + - 2010-02-12 15:49:00 - 2010-03-11 15:48:00 + + @@ -299,14 +299,14 @@ Web Design - 2010-04-15 16:08:00 - 2010-04-01 16:02:00 + + draft - + - 2010-03-09 16:00:00 - 2010-04-10 16:02:00 + + @@ -314,14 +314,14 @@ Development, Integration and Testing - 2010-04-27 17:29:00 - 2010-04-12 16:10:00 + + draft - + - 2010-03-10 16:11:00 - 2010-04-26 16:10:00 + + @@ -329,14 +329,14 @@ Website Deployment - 2010-04-30 16:35:00 - 2010-04-26 16:35:00 + + draft - + - 2010-03-10 16:35:00 - 2010-04-27 16:34:00 + + @@ -396,11 +396,11 @@ - - 2010-03-02 11:00:00 - + + + - 2010-02-24 05:00:00 + 2 @@ -408,17 +408,17 @@ Prepare Requirements Document - 2010-03-08 - - + + + - + - 2010-02-25 15:38:08 + 2 @@ -426,17 +426,17 @@ Define Website Goals, Purposes and Target Audience - 2010-03-04 - - + + + - - + + - 2010-02-25 15:42:42 + 2 @@ -444,9 +444,9 @@ Use Cases - 2010-03-10 - - + + + @@ -454,7 +454,7 @@ - 2010-02-25 15:51:00 + 2 @@ -462,7 +462,7 @@ Budget Planning - 2010-03-31 + @@ -472,7 +472,7 @@ - 2010-02-25 15:54:42 + 2 @@ -480,7 +480,7 @@ Quality Planning - 2010-03-31 + @@ -490,7 +490,7 @@ - 2010-02-25 15:55:11 + 2 @@ -498,7 +498,7 @@ Risk Management Planning - 2010-03-31 + @@ -508,7 +508,7 @@ - 2010-02-25 15:57:48 + 2 @@ -516,7 +516,7 @@ Create Project Schedules - 2010-03-31 + @@ -526,7 +526,7 @@ - 2010-02-25 16:04:16 + 2 @@ -534,7 +534,7 @@ Dataflow Design - 2010-04-02 + @@ -544,7 +544,7 @@ - 2010-02-25 16:05:43 + 2 @@ -552,9 +552,9 @@ User Interface Design - 2010-04-10 - - + + + @@ -562,7 +562,7 @@ - 2010-02-25 16:06:52 + 2 @@ -570,7 +570,7 @@ Task Level WBS - 2010-04-07 + @@ -580,7 +580,7 @@ - 2010-02-25 16:11:40 + 2 @@ -588,16 +588,17 @@ Modular Programming - 2010-04-22 + + - 2010-02-25 16:13:10 + 2 @@ -605,16 +606,17 @@ Integrate Modules - 2010-04-24 + + - + - 2010-02-25 16:14:32 + 2 @@ -622,16 +624,17 @@ Unit Testing - 2010-04-24 - - + + + + - 2010-02-25 16:15:38 + 2 @@ -639,16 +642,17 @@ Regression Test - 2010-04-24 + + - 2010-02-25 16:17:04 + 2 @@ -656,16 +660,17 @@ Documentation - 2010-04-24 + + - 2010-02-25 16:17:42 + 2 @@ -673,16 +678,17 @@ Performance Tuning - 2010-04-24 + + - 2010-02-25 16:21:15 + 2 @@ -690,171 +696,28 @@ Deploy Website - 2010-04-26 + + - - - - 2010-02-25 16:22:09 - - 2 - - - - - Presentation - 2010-04-28 - - - - - - - - - 2010-02-25 16:36:02 - - 2 - - - - - Deployment - 2010-04-28 - - - - - - - - - - 2010-02-25 16:36:43 - - 2 - - - - - Presentation - 2010-04-29 - - - - - - - - - - 2010-02-25 17:22:46 - - 2 - - - - - Modules Integration - 2010-04-24 - - - - - - - - - - 2010-02-25 17:34:32 - - 2 - - - - - Unit Testing - 2010-04-24 - - - - - - - - - - 2010-02-25 17:35:46 - - 2 - - - - - Modular Testing - 2010-04-24 - - - - - - - 2010-02-25 17:36:27 + 2 - Documentation - 2010-04-28 + Presentation + - - - - - - - - 2010-02-25 17:37:03 - - 2 - - - - - Performance Tuning - 2010-04-27 - - - - - - - - 2010-03-12 18:00:00 - - - 2010-03-01 12:00:00 - - 2 - - - - - Modular Programming - 2010-04-22 - - - + diff --git a/addons/project_planning/project_planning.py b/addons/project_planning/project_planning.py index 69dfde4e6bf..37f4096fb81 100644 --- a/addons/project_planning/project_planning.py +++ b/addons/project_planning/project_planning.py @@ -215,7 +215,7 @@ class project_task(osv.osv): def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): if not context: context = context - if not context.get('planning'): + if not context.get('planning', False): return super(project_task,self).search(cr, user, args, offset, limit, order, context) cr.execute(" SELECT t.id, t.name \ from project_task t \ From 8b1a49f548792d649f08b4df55d54dc92f32b0cc Mon Sep 17 00:00:00 2001 From: "pap (openerp)" Date: Thu, 15 Jul 2010 10:14:12 +0530 Subject: [PATCH 03/25] [IMP]:set start_date to current date when starting the project.task and timebox field should be visible only in timebox mode in tasks search view bzr revid: pap@tinyerp.co.in-20100715044412-mjr7jafkdyn4n3d9 --- addons/project/project.py | 13 +++---------- addons/project/project_view.xml | 1 + addons/project_gtd/project_gtd.py | 6 +++--- addons/project_gtd/project_gtd_view.xml | 6 +++--- 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/addons/project/project.py b/addons/project/project.py index 248fe00906c..399be972d50 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -345,13 +345,6 @@ class task(osv.osv): if task['date_start'] > task['date_end']: return False return True - - def _check_deadline_date(self, cr, uid, ids, context=None): - task = self.read(cr, uid, ids[0], ['date_start', 'date_deadline']) - if task['date_start'] and task['date_deadline']: - if task['date_deadline'] < task['date_start']: - return False - return True _columns = { 'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the task without removing it. This is basically used for the management of templates of projects and tasks."), @@ -363,6 +356,7 @@ class task(osv.osv): 'state': fields.selection([('draft', 'Draft'),('open', 'In Progress'),('pending', 'Pending'), ('cancelled', 'Cancelled'), ('done', 'Done')], 'State', readonly=True, required=True, help='If the task is created the state is \'Draft\'.\n If the task is started, the state becomes \'In Progress\'.\n If review is needed the task is in \'Pending\' state.\ \n If the task is over, the states is set to \'Done\'.'), + 'create_date': fields.datetime('Create Date', readonly=True), 'date_start': fields.datetime('Starting Date'), 'date_end': fields.datetime('Ending Date'), 'date_deadline': fields.date('Deadline'), @@ -392,7 +386,6 @@ class task(osv.osv): 'progress': 0, 'sequence': 10, 'active': True, - 'date_start': time.strftime('%Y-%m-%d %H:%M:%S'), 'project_id': _default_project, 'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'project.task', context=c) } @@ -461,7 +454,7 @@ class task(osv.osv): mail_send = True message = _('Task ') + " '" + task.name + "' "+ _("is Done.") self.log(cr, uid, task.id, message) - self.write(cr, uid, [task.id], {'state': 'done', 'date_end':time.strftime('%Y-%m-%d %H:%M:%S'), 'remaining_hours': 0.0}) + for parent_id in task.parent_ids: if parent_id.state in ('pending','draft'): reopen = True @@ -531,7 +524,7 @@ class task(osv.osv): def do_open(self, cr, uid, ids, *args): tasks= self.browse(cr,uid,ids) for t in tasks: - self.write(cr, uid, [t.id], {'state': 'open'}) + self.write(cr, uid, [t.id], {'state': 'open', 'date_start': time.strftime('%Y-%m-%d %H:%M:%S'),}) message = _('Task ') + " '" + t.name + "' "+ _("is Open.") self.log(cr, uid, t.id, message) return True diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml index 0a93da537d9..3c84aa6e783 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -316,6 +316,7 @@ + diff --git a/addons/project_gtd/project_gtd.py b/addons/project_gtd/project_gtd.py index 002b2af4e1b..0549dc0bedf 100644 --- a/addons/project_gtd/project_gtd.py +++ b/addons/project_gtd/project_gtd.py @@ -173,15 +173,15 @@ class project_task(osv.osv): if res['type'] == 'search': tt = timebox_obj.browse(cr, uid, timebox_obj.search(cr,uid,[])) search_extended ='''''' % (len(tt)+7,_('Getting Things Done')) - search_extended += '''''' % (_('Inbox'),) - search_extended += '''''' % (_('Editable'),) + search_extended += '''''' % (_('Inbox'),) +# search_extended += '''''' % (_('Editable'),) search_extended += '''''' for time in tt: if time.icon: icon = time.icon else : icon="" - search_extended += '''''' + search_extended += '''''' search_extended += ''' diff --git a/addons/project_gtd/project_gtd_view.xml b/addons/project_gtd/project_gtd_view.xml index aa78b6332b0..8527b480955 100644 --- a/addons/project_gtd/project_gtd_view.xml +++ b/addons/project_gtd/project_gtd_view.xml @@ -78,9 +78,9 @@ -