2 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.
4 Creating a project OpenERP Documentation
6 !record {model: project.project, id: project_project_openerpdocumentation0}:
7 company_id: base.main_company
8 name: OpenERP Documentation
11 Creating a task 'Develop book for Technical and Functional reference'
13 !record {model: project.task, id: project_task_documentation_book}:
14 name: Develop book for Technical and Functional reference
16 project_id: project_project_openerpdocumentation0
23 !python {model: project.task}: |
24 self.do_open(cr, uid, [ref("project_task_documentation_book")],
25 {"lang": "en_US", "active_model": "ir.ui.menu", "active_ids": [ref("project.menu_action_view_task")],
26 "tz": False, "active_id": ref("project.menu_action_view_task"), })
29 Creating a task 'Publish the References'
31 !record {model: project.task, id: project_task_publish_book}:
32 name: Publish the References
34 project_id: project_project_openerpdocumentation0
41 !python {model: project.task}: |
42 self.do_open(cr, uid, [ref("project_task_publish_book")],
43 {"lang": "en_US", "active_model": "ir.ui.menu", "active_ids": [ref("project.menu_action_view_task")],
44 "tz": False, "active_id": ref("project.menu_action_view_task"), })
47 Test the delegate wizard
49 Creating a delegate task 'Publish the References' of 15 hours, renaming parent task to 'CHECK Publish the References' of 1 hour
51 !record {model: project.task.delegate, id: project_task_publish_book_delegate}:
52 name: Publish the References
53 new_task_description: aaa
56 prefix: 'CHECK: Publish the References'
58 user_id: base.user_demo
61 Validating the delegate task
63 !python {model: project.task.delegate}: |
64 self.delegate(cr, uid, [ref("project_task_publish_book_delegate")],
65 {"lang": "en_US", "active_model": "project.task", "tz": False, "record_id":
66 4, "active_ids": [ref("project_task_publish_book")], "active_id": ref("project_task_publish_book"),
70 Check if parent task 'CHECK Publish the References' is in pending state
72 !assert {model: project.task, id: project_task_publish_book, severity: error, string: "Task must be in pending state after delegation"}:
75 Creating a delegate task 'Prepare a book that gives functional overview of OpenERP'
77 !record {model: project.task, id: project_task_delegate_openerp_tutorial}:
78 name: Prepare a book that gives functional overview of OpenERP
80 project_id: project.project_project_openerpdocumentation0
87 !python {model: project.task}: |
88 self.do_open(cr, uid, [ref("project_task_delegate_openerp_tutorial")],
89 {"lang": "en_US", "active_model": "ir.ui.menu", "active_ids": [ref("project.menu_action_view_task")],
90 "tz": False, "active_id": ref("project.menu_action_view_task"), })
93 Creating a delegate task 'Prepare a technical reference for creating your modules'
95 !record {model: project.task, id: project_task_delegate_developer_book}:
96 name: Prepare a technical reference for creating your modules
98 project_id: project_project_openerpdocumentation0
105 !python {model: project.task}: |
106 self.do_open(cr, uid, [ref("project_task_delegate_developer_book")],
107 {"lang": "en_US", "active_model": "ir.ui.menu", "active_ids": [ref("project.menu_action_view_task")],
108 "tz": False, "active_id": ref("project.menu_action_view_task"), })
111 Delegate task 'Develop book for Technical and Functional reference' to these tasks and make it pending
113 !record {model: project.task, id: project_task_documentation_book}:
115 - project.project_task_delegate_openerp_tutorial
116 - project.project_task_delegate_developer_book
121 Creating a delegate task 'Prepare documentation for Module Development'
123 !record {model: project.task, id: project_task_delegate_module_develop}:
124 name: Prepare documentation for Module Development
126 project_id: project.project_project_openerpdocumentation0
127 remaining_hours: 30.0
132 Creating a delegate 'Prepare documentation for Business Process Development'
134 !record {model: project.task, id: project_task_delegate_business_process_develop}:
135 name: Prepare documentation for Business Process Development
137 project_id: project_project_openerpdocumentation0
138 remaining_hours: 30.0
142 Delegate task 'Prepare a technical reference for creating your modules' to these tasks and make it pending
144 !record {model: project.task, id: project_task_delegate_developer_book}:
146 - project.project_task_delegate_module_develop
147 - project.project_task_delegate_business_process_develop
154 !python {model: project.task}: |
155 self.do_open(cr, uid, [ref("project_task_delegate_module_develop")],
156 {"lang": "en_US", "active_model": "ir.ui.menu", "active_ids": [ref("project.menu_action_view_task")],
157 "tz": False, "active_id": ref("project.menu_action_view_task"), })
162 !python {model: project.task}: |
163 self.do_open(cr, uid, [ref("project_task_delegate_business_process_develop")],
164 {"lang": "en_US", "active_model": "ir.ui.menu", "active_ids": [ref("project.menu_action_view_task")],
165 "tz": False, "active_id": ref("project.menu_action_view_task"), })
168 Check if 'Prepare a technical reference for creating your modules' in pending state
170 !assert {model: project.task, id: project_task_delegate_developer_book, severity: error, string: Task must be in pending state}:
174 Close the child task 'Prepare documentation for Module Development'
176 !python {model: project.task}: |
177 self.do_close(cr, uid, [ref("project_task_delegate_module_develop")], {"lang": "en_US",
178 "active_ids": [ref("project.menu_action_view_task")], "tz": False, "active_model":
179 "ir.ui.menu", "section_id": False, "search_default_project_id": False, "search_default_user_id":
180 1, "search_default_current": 1, "mail_send": False, "active_id": ref("project.menu_action_view_task"),
184 Close the child task 'Prepare documentation for Business Process Development'
186 !python {model: project.task}: |
187 self.do_close(cr, uid, [ref("project_task_delegate_business_process_develop")], {"lang": "en_US",
188 "active_ids": [ref("project.menu_action_view_task")], "tz": False, "active_model":
189 "ir.ui.menu", "section_id": False, "search_default_project_id": False, "search_default_user_id":
190 1, "search_default_current": 1, "mail_send": False, "active_id": ref("project.menu_action_view_task"),
194 Parent task 'Prepare a technical reference for creating your modules' task must now be in open state
196 !assert {model: project.task, id: project_task_delegate_developer_book, severity: error, string: Task is in done state}:
201 Check if task 'Develop book for Technical and Functional reference' in pending state
203 !assert {model: project.task, id: project_task_documentation_book, severity: error, string: Task is in pending state}:
207 Close the child task 'Prepare a technical reference for creating your modules'
209 !python {model: project.task}: |
210 self.do_close(cr, uid, [ref("project_task_delegate_developer_book")], {"lang": "en_US",
211 "active_ids": [ref("project.menu_action_view_task")], "tz": False, "active_model":
212 "ir.ui.menu", "section_id": False, "search_default_project_id": False, "search_default_user_id":
213 1, "search_default_current": 1, "mail_send": False, "active_id": ref("project.menu_action_view_task"),
217 Close the child task 'Prepare a book that gives functional overview of OpenERP'
219 !python {model: project.task}: |
220 self.do_close(cr, uid, [ref("project_task_delegate_openerp_tutorial")], {"lang": "en_US",
221 "active_ids": [ref("project.menu_action_view_task")], "tz": False, "active_model":
222 "ir.ui.menu", "section_id": False, "search_default_project_id": False, "search_default_user_id":
223 1, "search_default_current": 1, "mail_send": False, "active_id": ref("project.menu_action_view_task"),
227 Parent task 'Develop book for Technical and Functional reference' must be now in open state
229 !assert {model: project.task, id: project_task_documentation_book, severity: error, string: Task is in done state}: