diff --git a/addons/project/test/test_project.yml b/addons/project/test/test_project.yml index b6a081dc659..ff823db7063 100644 --- a/addons/project/test/test_project.yml +++ b/addons/project/test/test_project.yml @@ -4,9 +4,9 @@ !record {model: res.users, id: base.user_root}: user_email: admin@openerp.com - - I test project template feature + I test project template feature. - - I create test project 'OpenERP Test Programme' + I create test project 'OpenERP Test Programme'. - !record {model: project.project, id: project_project_testprogramme0}: company_id: base.main_company @@ -18,7 +18,7 @@ name : account_analytic_account partner_id: base.res_partner_asus - - I create project 'OpenERP Training Programme' + I create project 'OpenERP Training Programme'. - !record {model: project.project, id: project_project_openerptrainingprogramme0}: company_id: base.main_company @@ -28,7 +28,7 @@ date_start: !eval time.strftime('%Y-%m-%d') date: !eval time.strftime('%Y-%m-%d') - - I create task 'Technical Training' for this project + I create task 'Technical Training' for this project. - !record {model: project.task, id: project_task_technicaltraining0}: date_start: !eval time.strftime('%Y-%m-%d %H:%M:%S') @@ -39,7 +39,7 @@ remaining_hours: 30.0 state: draft - - I create task 'Training' for this project + I create task 'Training' for this project. - !record {model: project.task, id: project_task_child0}: date_start: !eval time.strftime('%Y-%m-%d %H:%M:%S') @@ -49,7 +49,7 @@ remaining_hours: 30.0 state: done - - I create task 'Functional Training' for this project + I create task 'Functional Training' for this project. - !record {model: project.task, id: project_task_functionaltraining0}: date_start: !eval time.strftime('%Y-%m-%d %H:%M:%S') @@ -61,7 +61,7 @@ - project_task_child0 state: draft - - I set project's task view + I set project's task view. - !python {model: project.task}: | context.update({'project_id': ref('project_task_functionaltraining0')}) @@ -79,7 +79,7 @@ !python {model: project.task}: | self.do_open(cr, uid,[ref("project_task_functionaltraining0")],context={}) - - I click Pending button + I click Pending button. - !python {model: project.task}: | self.do_pending(cr, uid, [ref("project_task_functionaltraining0")], context={}) @@ -125,7 +125,7 @@ name: Technical Training Task's Work task_id: project_task_technicaltraining0 - - I create project's Work + I create project's Work. - !python {model: project.task.work}: | vals = { @@ -135,7 +135,7 @@ } self.create(cr, uid, vals,context={"lang": "en_US", "active_ids": [ref("project_task_functionaltraining0")],"tz": False, "active_id": ref("project_task_functionaltraining0")}) - - I add project's Work + I add project's Work. - !python {model: project.task.work}: | vals = { @@ -145,7 +145,7 @@ } self.write(cr, uid, [ref('project_task_work0')], vals, context={"lang": "en_US", "active_ids": [ref("project_task_functionaltraining0")],"tz": False, "active_id": ref("project_task_functionaltraining0")}) - - I get project's Work + I get project's Work. - !python {model: project.project}: | self._get_project_work(cr, uid, [ref("project_task_work0")], context={"lang": "en_US", "active_ids": [ref("project_task_functionaltraining0")],"tz": False, "active_id": ref("project_task_functionaltraining0")}) @@ -155,19 +155,19 @@ !python {model: project.project}: | self.onchange_partner_id(cr, uid, [ref("project_project_openerptrainingprogramme0")], part=ref('base.res_partner_asus'), context = {"lang": "en_US", "active_model": "ir.ui.menu", "active_ids": [ref("project.menu_open_view_project_all")],"tz": False, "active_id": ref("project.menu_open_view_project_all")}) - - I set project as project template + I set project as project template. - !python {model: project.project}: | self.set_template(cr, uid, [ref("project_project_openerptrainingprogramme0")], {"lang": "en_US", "active_model": "ir.ui.menu", "active_ids": [ref("project.menu_open_view_project_all")], "tz": False, "active_id": ref("project.menu_open_view_project_all"), }) - - I check if project in template state + I check if project in template state. - !assert {model: project.project, id: project_project_openerptrainingprogramme0, severity: error, string: Project is in template state}: - state == "template" - - I create new project based on this template + I create new project based on this template. - !python {model: project.project}: | new_prj = self.duplicate_template(cr, uid, [ref("project_project_openerptrainingprogramme0")], @@ -181,7 +181,7 @@ name = new_prj['name'] assert state == 'open', "Project in %s state. Project created from template project must be in open state"%state - - I reset project template to normal project + I reset project template to normal project. - !python {model: project.project}: | self.reset_project(cr, uid, [ref("project_project_openerptrainingprogramme0")], {"lang": "en_US", "active_ids": @@ -189,14 +189,14 @@ "ir.ui.menu", "project_id": False, "active_id": ref("project.menu_open_view_project_all"), }) - - I check if project in open state + I check if project in open state. - !assert {model: project.project, id: project_project_openerptrainingprogramme0, severity: error, string: Project is in open state}: - state == "open" - - I test for different project-states + I test for different project-states. - - Keep project pending + Keep project pending. - !python {model: project.project}: | self.set_pending(cr, uid, [ref("project_project_openerptrainingprogramme0")], {"lang": "en_US", "active_ids": @@ -204,12 +204,12 @@ "ir.ui.menu", "project_id": False, "active_id": ref("project.menu_open_view_project_all"), }) - - I check if project in pending state + I check if project in pending state. - !assert {model: project.project, id: project_project_openerptrainingprogramme0, severity: error, string: Project is in pending state}: - state == "pending" - - I cancel the project + I cancel the project. - !python {model: project.project}: | self.set_cancel(cr, uid, [ref("project_project_openerptrainingprogramme0")], {"lang": "en_US", "active_ids": @@ -217,31 +217,31 @@ "ir.ui.menu", "project_id": False, "active_id": ref("project.menu_open_view_project_all"), }) - - I check if project in cancel state + I check if project in cancel state. - !assert {model: project.project, id: project_project_openerptrainingprogramme0, severity: error, string: Project is in cancel state}: - state == "cancelled" - - Re-open the project + Re-open the project. - !python {model: project.project}: | self.set_open(cr, uid, [ref("project_project_openerptrainingprogramme0")], {"lang": "en_US", "active_ids": [ref("project.menu_open_view_project_all")], "tz": False, "active_model": "ir.ui.menu", "project_id": False, "active_id": ref("project.menu_open_view_project_all"), }) - - Re-Check if project in open state + Re-Check if project in open state. - !assert {model: project.project, id: project_project_openerptrainingprogramme0, severity: error, string: Project is in open state}: - state == "open" - - I test for task work allocation + I test for task work allocation. - - As I cancelled my project before, i check if the task 'Technical Training' is in cancelled state + As I cancelled my project before, i check if the task 'Technical Training' is in cancelled state. - !assert {model: project.task, id: project_task_technicaltraining0, severity: error, string: Task is in cancelled state}: - state == "cancelled" - - Now, in order to reactivate the task 'Technical Training', i click on the "Reactivate" button and fill the remaining hour field + Now, in order to reactivate the task 'Technical Training', i click on the "Reactivate" button and fill the remaining hour field. - !record {model: project.task.reevaluate, id: project_task_technicaltraining_remainingwiz0}: remaining_hours: 30.0 @@ -261,7 +261,7 @@ !python {model: project.task.reevaluate}: | self.compute_hours(cr, uid, [ref('project_task_technicaltraining_remainingwiz0')], {'active_id': ref("project_task_technicaltraining0"),'button_reactivate': True}) - | - I check if task 'Technical Training' in open state and for other initial values + I check if task 'Technical Training' in open state and for other initial values. - !assert {model: project.task, id: project_task_technicaltraining0, severity: error, string: Project is in open state}: - state == "open" @@ -270,7 +270,7 @@ - delay_hours == 0.0 - effective_hours == 0.0 - - I create a work task entry 'Training on OpenERP modules, models and classes' of 10 hours + I create a work task entry 'Training on OpenERP modules, models and classes' of 10 hours. - !record {model: project.task, id: project_task_technicaltraining0, context:{'no_analytic_entry':True}}: work_ids: @@ -279,13 +279,13 @@ name: Training on OpenERP modules, models and classes user_id: base.user_root - - I check for effective hours and remaining hours, effective_hours must be equal to 10 + I check for effective hours and remaining hours, effective_hours must be equal to 10. - !assert {model: project.task, id: project_task_technicaltraining0, severity: error, string: After work task of 10 hours effective_hours must be equal to 10}: - remaining_hours == 20 - effective_hours == 10.0 - - I create a work task entry 'Training on OpenERP xml views' of 10 hours + I create a work task entry 'Training on OpenERP xml views' of 10 hours. - !record {model: project.task, id: project_task_technicaltraining0, context:{'no_analytic_entry':True}}: work_ids: @@ -294,13 +294,13 @@ name: Training on OpenERP xml views user_id: base.user_root - - I check for effective hours and remaining hours, effective_hours must be equal to 20 + I check for effective hours and remaining hours, effective_hours must be equal to 20. - !assert {model: project.task, id: project_task_technicaltraining0, severity: error, string: After one more work task of 10 hours effective_hours must be equal to 20}: - remaining_hours == 10 - effective_hours == 20.0 - - I create a work task entry 'Training on workflows' of 10 hours + I create a work task entry 'Training on workflows' of 10 hours. - !record {model: project.task, id: project_task_technicaltraining0, context:{'no_analytic_entry':True}}: work_ids: @@ -309,19 +309,19 @@ name: Training on workflows user_id: base.user_root - - I check for effective hours and remaining hours, effective_hours must be equal to 30 + I check for effective hours and remaining hours, effective_hours must be equal to 30. - !assert {model: project.task, id: project_task_technicaltraining0, severity: error, string: After one more work task of 10 hours effective_hours must be equal to 30}: - remaining_hours == 0 - effective_hours == 30.0 - - I set remaining hours of 10 hours for reevaluating the task + I set remaining hours of 10 hours for reevaluating the task. - !record {model: project.task.reevaluate, id: config_compute_remaining_0}: remaining_hours: 10.0 - - I reevaluate the task + I reevaluate the task. - !python {model: project.task.reevaluate}: | self.compute_hours(cr, uid, [ref("config_compute_remaining_0")], {"lang": "en_US", @@ -330,14 +330,14 @@ [ref("project_task_technicaltraining0")], "active_id": ref("project_task_technicaltraining0"), }) - - I check for effective hours and remaining hours, remaining_hours must be 10 while planned_hours remains 30 + I check for effective hours and remaining hours, remaining_hours must be 10 while planned_hours remains 30. - !assert {model: project.task, id: project_task_technicaltraining0, severity: error, string: After reevaluating the task with 10 hours remaining_hours must be 10 while planned_hours remains 30}: - planned_hours == 30 - remaining_hours == 10.0 - effective_hours == 30.0 - - I create a work task entry 'Training on reports and wizards' of 10 hours + I create a work task entry 'Training on reports and wizards' of 10 hours. - !record {model: project.task, id: project_task_technicaltraining0, context:{'no_analytic_entry':True}}: work_ids: @@ -346,31 +346,31 @@ name: Training on reports and wizards user_id: base.user_root - - I check for effective hours and remaining hours + I check for effective hours and remaining hours. - !assert {model: project.task, id: project_task_technicaltraining0, severity: error, string: After one more work task of 10 hours effective_hours must be equal to 40 while planned_hours remains 30}: - planned_hours == 30 - remaining_hours == 0 - effective_hours == 40.0 - - I close the task + I close the task. - !python {model: project.task}: | self.do_close(cr, uid, [ref("project_task_technicaltraining0")], {'mail_send': False}) - - I check if task in done state + I check if task in done state. - !assert {model: project.task, id: project_task_technicaltraining0, severity: error, string: Task is in done state}: - state == "done" - - I test for task reactivation + I test for task reactivation. - - I reactivate task + I reactivate task. - !record {model: project.task.reevaluate, id: config_compute_remaining_1}: remaining_hours: 10.0 - - Reevaluate the task with 10 hours remaining + Reevaluate the task with 10 hours remaining. - !python {model: project.task.reevaluate}: | self.compute_hours(cr, uid, [ref("config_compute_remaining_1")], {"lang": "en_US", @@ -379,14 +379,14 @@ 1, "search_default_current": 1, "active_ids": [ref("project_task_technicaltraining0")], "active_id": ref("project_task_technicaltraining0"), }) - - I check for effective hours and remaining hours, remaining_hours must be 10 while planned_hours remains 30 + I check for effective hours and remaining hours, remaining_hours must be 10 while planned_hours remains 30. - !assert {model: project.task, id: project_task_technicaltraining0, severity: error, string: After reevaluating the task with 10 hours remaining_hours must be 10 while planned_hours remains 30}: - planned_hours == 30 - remaining_hours == 10.0 - effective_hours == 40.0 - - I create a work task entry 'Training on yml' of 5 hours + I create a work task entry 'Training on yml' of 5 hours. - !record {model: project.task, id: project_task_technicaltraining0, context:{'no_analytic_entry':True}}: work_ids: @@ -395,36 +395,36 @@ name: Training on yml user_id: base.user_root - - I check for effective hours and remaining hours, remaining_hours must be 5, effective_hours must be 45 + I check for effective hours and remaining hours, remaining_hours must be 5, effective_hours must be 45. - !assert {model: project.task, id: project_task_technicaltraining0, severity: error, string: After work task of 5 hours effective_hours must be equal to 45 and remaining_hours is 5}: - planned_hours == 30 - remaining_hours == 5.0 - effective_hours == 45.0 - - Check for remaining hours + Check for remaining hours. - !python {model: project.task}: | self.onchange_remaining(cr, uid, [ref("project_task_functionaltraining0")], remaining = 10.0, planned = False) - - I close the task + I close the task. - !python {model: project.task}: | self.do_close(cr, uid, [ref("project_task_technicaltraining0")], {'mail_send': False}) - - I check if task in done state + I check if task in done state. - !assert {model: project.task, id: project_task_technicaltraining0, severity: error}: - state == "done" - - I check for effective hours and remaining hours + I check for effective hours and remaining hours. - !assert {model: project.task, id: project_task_technicaltraining0, severity: error, string: After closing the task planned_hours must remain 30 effective_hours must be 45 and remaining hours must be 0}: - planned_hours == 30 - remaining_hours == 0.0 - effective_hours == 45.0 - - Now, Execute the search method + Now, Execute the search method. - !python {model: project.project}: | context.update({"lang": "en_US", "active_ids": [ref("project.menu_open_view_project_all")], @@ -436,12 +436,12 @@ except: pass - - I copy project 'OpenERP Training Programme' + I copy project 'OpenERP Training Programme'. - !python {model: project.project}: | self.copy(cr, uid, ref("project_project_testprogramme0"), default={}, context=None) - - I close project 'OpenERP Training Programme' + I close project 'OpenERP Training Programme'. - !python {model: project.project}: | context.update({"lang": "en_US", "active_ids": [ref("project.menu_open_view_project_all")], @@ -460,7 +460,7 @@ self.set_done(cr, uid, [ref("project_project_openerptrainingprogramme0")], context=context) - - I check if project in close state + I check if project in close state. - !assert {model: project.project, id: project_project_openerptrainingprogramme0, severity: error, string: "Project must be in closed state"}: - state == "close" @@ -480,7 +480,7 @@ self.create(cr, uid, vals, context=None) self.unlink(cr, uid, [ref('account_analytic_account0')]) - - I close the project task + I close the project task. - !record {model: project.task.close, id: project_task_close_0}: manager_warn : True @@ -505,7 +505,7 @@ except : pass - - I check for remaining hours + I check for remaining hours. - !python {model: project.task}: | self.onchange_remaining(cr, uid, [ref("project_task_functionaltraining0")], remaining = 0.0, planned = 0.0) @@ -530,4 +530,3 @@ - !python {model: project.project}: | self.unlink(cr, uid, [ref('project_project_testprogramme0')]) - diff --git a/addons/project/test/test_project_delegation.yml b/addons/project/test/test_project_delegation.yml index 9501e8f9b48..2aabb0a4766 100644 --- a/addons/project/test/test_project_delegation.yml +++ b/addons/project/test/test_project_delegation.yml @@ -1,14 +1,14 @@ - 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. - - I creating a project OpenERP Documentation + I create a project OpenERP Documentation. - !record {model: project.project, id: project_project_openerpdocumentation0}: company_id: base.main_company name: OpenERP Documentation - - I creating a task 'Develop book for Technical and Functional reference' + I create 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 @@ -17,14 +17,14 @@ remaining_hours: 20.0 state: pending - - I open the 'Develop book for Technical and Functional reference' task + I open the 'Develop book for Technical and Functional reference' 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"), }) - - I creating a task 'Publish the References' + I create a task 'Publish the References'. - !record {model: project.task, id: project_task_publish_book}: name: Publish the References @@ -34,7 +34,7 @@ state: draft - - I open the task 'Publish the References' + I open the task 'Publish the References'. - !python {model: project.task}: | self.do_open(cr, uid, [ref("project_task_publish_book")], @@ -42,9 +42,9 @@ "tz": False, "active_id": ref("project.menu_action_view_task"), }) - - I test the delegate wizard + I test the delegate wizard. - - I am creating a delegate task 'Publish the References' of 15 hours, renaming parent task to 'CHECK Publish the References' of 1 hour + I create a delegate task 'Publish the References' of 15 hours, renaming parent task to 'CHECK Publish the References' of 1 hour. - !record {model: project.task.delegate, id: project_task_publish_book_delegate}: name: Publish the References @@ -71,17 +71,17 @@ self.default_get(cr, uid, fields, context=context) self.fields_view_get(cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False) - - I am validating the delegate task. + I validate the delegate task. - !python {model: project.task.delegate}: | self.delegate(cr, uid, [ref('project_task_publish_book_delegate')], {"active_id": ref("project_task_publish_book")}) - - I check if parent task 'CHECK Publish the References' is in pending state + I check if parent task 'CHECK Publish the References' is in pending state. - !assert {model: project.task, id: project_task_publish_book, severity: error, string: "Task must be in pending state after delegation"}: - state == "pending" - - I am creating a delegate task 'Prepare a book that gives functional overview of OpenERP' + I create 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 @@ -91,7 +91,7 @@ state: draft - - I open the delegate task 'Prepare a book that gives functional overview of OpenERP' + I open the delegate task 'Prepare a book that gives functional overview of OpenERP'. - !python {model: project.task}: | self.do_open(cr, uid, [ref("project_task_delegate_openerp_tutorial")], @@ -99,7 +99,7 @@ "tz": False, "active_id": ref("project.menu_action_view_task"), }) - - I am creating a delegate task 'Prepare a technical reference for creating your modules' + I create 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 @@ -109,7 +109,7 @@ state: draft - - I open the delegate task 'Prepare a technical reference for creating your modules' + I open the delegate task 'Prepare a technical reference for creating your modules'. - !python {model: project.task}: | self.do_open(cr, uid, [ref("project_task_delegate_developer_book")], @@ -117,7 +117,7 @@ "tz": False, "active_id": ref("project.menu_action_view_task"), }) - - Now, delegate task 'Develop book for Technical and Functional reference' to these tasks and make it pending + Now, 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: @@ -127,7 +127,7 @@ state: pending - - I am creating a delegate task 'Prepare documentation for Module Development' + I create a delegate task 'Prepare documentation for Module Development'. - !record {model: project.task, id: project_task_delegate_module_develop}: name: Prepare documentation for Module Development @@ -138,7 +138,7 @@ - - I am creating a delegate 'Prepare documentation for Business Process Development' + I create 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 @@ -148,7 +148,7 @@ state: draft - - Now, delegate task 'Prepare a technical reference for creating your modules' to these tasks and make it pending + Now, 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: @@ -158,7 +158,7 @@ state: pending - - I open the task 'Prepare documentation for Business Process Development' + I open the task 'Prepare documentation for Business Process Development'. - !python {model: project.task}: | self.do_open(cr, uid, [ref("project_task_delegate_module_develop")], @@ -166,20 +166,20 @@ "tz": False, "active_id": ref("project.menu_action_view_task"), }) - - I open the task 'Prepare documentation for Business Process Development' + I open the task 'Prepare documentation for Business Process Development'. - !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"), }) - - I check if 'Prepare a technical reference for creating your modules' in pending state + I 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 must be in pending state}: - state == "pending" - - I close the child task 'Prepare documentation for Module Development' + I 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", @@ -189,7 +189,7 @@ }) - - I close the child task 'Prepare documentation for Business Process Development' + I 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", @@ -199,20 +199,20 @@ }) - - Parent task 'Prepare a technical reference for creating your modules' task must now be in open state + 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" - - I check if task 'Develop book for Technical and Functional reference' in pending state + I 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" - - I close the child task 'Prepare a technical reference for creating your modules' + I close the child task '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", @@ -222,7 +222,7 @@ }) - - I close the child task 'Prepare a book that gives functional overview of OpenERP' + I close the child task '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", @@ -232,7 +232,7 @@ }) - - Parent task 'Develop book for Technical and Functional reference' must be now in open state + 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" diff --git a/addons/project_gtd/test/gtd_test.yml b/addons/project_gtd/test/gtd_test.yml index 35268cd49fd..539180db2ed 100644 --- a/addons/project_gtd/test/gtd_test.yml +++ b/addons/project_gtd/test/gtd_test.yml @@ -1,5 +1,5 @@ - - Create a task 'Develop time management module' with monthly timebox + I create a task 'Develop time management module' with monthly timebox. - !record {model: project.task, id: project_task_developtimemanagementmodule0}: name: Develop time management module @@ -9,7 +9,7 @@ state: draft timebox_id: project_gtd.timebox_monthly - - Copy the task + I copy the task. - !python {model: project.task}: | self.copy_data(cr, uid, ref("project_task_developtimemanagementmodule0"), default=None, context=None) @@ -20,17 +20,17 @@ self.fields_view_get(cr, uid, view_id=None, view_type='form', context={'active_id':ref('project_task_developtimemanagementmodule0')}, toolbar=False, submenu=False) self.fields_view_get(cr, uid, view_id=None, view_type='search', context={'active_id':ref('project_task_developtimemanagementmodule0')}, toolbar=False, submenu=False) - - Change the time to next + I change the time to next. - !python {model: project.task}: | self.next_timebox(cr, uid, [ref("project_task_developtimemanagementmodule0")]) - - Change the time to previous + I change the time to previous. - !python {model: project.task}: | self.prev_timebox(cr, uid, [ref("project_task_developtimemanagementmodule0")]) - - Open the task + Open the task. - !python {model: project.task}: | self.do_open(cr, uid, [ref("project_task_developtimemanagementmodule0")], {"lang": @@ -40,19 +40,19 @@ [ref("project.menu_action_view_task")], "active_id": ref("project.menu_action_view_task"), }) - - Create time box for next week + I create time box for next week. - !record {model: project.gtd.timebox, id: project_gtd_timebox_nextweek0}: name: Next Week sequence: 0.0 - - Create time box for tomorrow + I create time box for tomorrow. - !record {model: project.gtd.timebox, id: project_gtd_timebox_tomorrow1}: name: Tomorrow sequence: 0.0 - - Planify the task from monthly timebox to tomorrow timebox + Planify the task from monthly timebox to tomorrow timebox. - !record {model: project.timebox.fill.plan, id: project_timebox_fill_plan_0}: task_ids: @@ -60,7 +60,7 @@ timebox_id: project_gtd.timebox_monthly timebox_to_id: project_gtd_timebox_tomorrow1 - - Set the task to tomorrow timebox + Set the task to tomorrow timebox. - !python {model: project.timebox.fill.plan}: | self._get_from_tb(cr, uid, context=None) @@ -71,12 +71,12 @@ [ref("project_gtd.timebox_daily")], "active_id": ref("project_gtd.timebox_daily"), }) - - Check if task set to tomorrow timebox + I check if task set to tomorrow timebox. - !assert {model: project.task, id: project_task_developtimemanagementmodule0, string: Task set to tomorrow timebox}: - timebox_id.id == ref("project_gtd_timebox_tomorrow1") - - Empty Timebox for tomorrow + Empty Timebox for tomorrow. - !python {model: project.timebox.empty}: | self.view_init(cr , uid , fields_list={}, context=None) @@ -86,7 +86,7 @@ [ref("project_gtd_timebox_tomorrow1")], "active_id": ref("project_gtd_timebox_tomorrow1"), }) - - Check task 'Develop time management module' is no more in tomorrow timebox + I check task 'Develop time management module' is no more in tomorrow timebox. - !assert {model: project.task, id: project_task_developtimemanagementmodule0, string: Task is not in tomorrow timebox}: - timebox_id.id != ref("project_gtd_timebox_tomorrow1") diff --git a/addons/project_issue/test/convert_issue_to_task.yml b/addons/project_issue/test/convert_issue_to_task.yml index e3297f5be1b..2d6d96359d8 100644 --- a/addons/project_issue/test/convert_issue_to_task.yml +++ b/addons/project_issue/test/convert_issue_to_task.yml @@ -1,5 +1,5 @@ - - Create task 'Training' for this project + I create task 'Training' for this project. - !record {model: project.task, id: project_task_training0}: date_start: !eval time.strftime('%Y-%m-%d %H:%M:%S') @@ -10,7 +10,7 @@ remaining_hours: 30.0 state: draft - - Create a project issue + I create a project issue. - !record {model: project.issue, id: project_issue_onchangeevent0}: categ_id: project_issue.bug_categ @@ -21,12 +21,12 @@ working_hours_close: 0.0 working_hours_open: 0.0 - - Check there is no task attached to project issue + I check there is no task attached to project issue. - !assert {model: project.issue, id: project_issue_onchangeevent0, string: There must not be any task attached to issue}: - task_id.id == False - - Compute the days. + I compute the days. - !python {model: project.issue}: | import time @@ -43,7 +43,7 @@ } self._compute_day(cr, uid, [ref('project_issue_onchangeevent0')], fields, args, context=None) - - Convert project issue to task + I convert project issue to task. - !python {model: project.issue}: | try: @@ -58,55 +58,55 @@ ref("project_issue.menu_project_issue_track"), }) - - Check there is a task attached to project issue + I check there is a task attached to project issue. - !assert {model: project.issue, id: project_issue_onchangeevent0, string: After creating a task for the issue there must be a task attached to it}: - task_id.id != False - - Get project issue's task work + Get project issue's task work. - !python {model: project.issue}: | context.update({'project_id':ref('project.project_project_22')}) self._get_project(cr, uid, context) - - Creat some changes on project + I creat some changes on project. - !python {model: project.issue}: | self.on_change_project(cr, uid, [ref("project_issue_onchangeevent0")],context) - - Go to next issue. + Now, go to next issue. - !python {model: project.issue}: | self.next_type(cr, uid, [ref("project_issue_onchangeevent0")]) - - Go to Previous issue. + Now, go to Previous issue. - !python {model: project.issue}: | self.prev_type(cr, uid, [ref("project_issue_onchangeevent0")]) - - Check the task. + I check the task. - !python {model: project.issue}: | self.onchange_task_id(cr, uid, [ref("project_issue_onchangeevent0")], ref('project_task_training0'),context=None) - - Convert Issue to Feature. + I convert Issue to Feature. - !python {model: project.issue}: | self.convert_to_feature(cr, uid, [ref("project_issue_onchangeevent0")]) - - Convert Issue to Bug. + I convert Issue to Bug. - !python {model: project.issue}: | self.convert_to_bug(cr, uid, [ref("project_issue_onchangeevent0")]) - - Copy the issue. + I copy the issue. - !python {model: project.issue}: | default=None context=None self.copy(cr, uid, ref("project_issue_onchangeevent0"),default, context) - - Create Message. + I create Message. - !python {model: project.issue}: | msg = { @@ -116,7 +116,7 @@ } self.message_new(cr, uid,msg,context) - - Update this messages. + I update this messages. - !python {model: project.issue}: | vals = {} @@ -129,7 +129,7 @@ default_act = 'pending' self.message_update(cr, uid, [ref('project_issue_onchangeevent0')], vals, msg, default_act, context) - - Send created and update the messages. + I send created and update the messages. - !python {model: project.issue}: | self.msg_send(cr, uid, [ref('project_issue_onchangeevent0')]) diff --git a/addons/project_issue/test/test_project_issue_states.yml b/addons/project_issue/test/test_project_issue_states.yml index f1767c6af99..b903e032499 100644 --- a/addons/project_issue/test/test_project_issue_states.yml +++ b/addons/project_issue/test/test_project_issue_states.yml @@ -4,12 +4,12 @@ !record {model: project.project, id: project.project_project_22}: project_escalation_id: project.project_project_21 - - Check escalate the project assign + I check escalate the project assign. - !python {model: project.project}: | - self._check_escalation(cr, uid, [ref('project.project_project_22')], context=None) + self._check_escalation(cr, uid, [ref('project.project_project_22')], context=None) - - Create an issue for "Specific Developments" project + I create an issue for "Specific Developments" project. - !record {model: project.issue, id: project_issue_stockmovedates0}: categ_id: project_issue.bug_categ @@ -18,28 +18,28 @@ project_id: project.project_project_22 working_hours_close: 0.0 working_hours_open: 0.0 -- - Check if issue in 'draft' state +- + I check if issue in 'draft' state. - !assert {model: project.issue, id: project_issue_stockmovedates0, severity: error, string: Issue is in draft state}: - state == 'draft' -- - Open the issue -- +- + I open the issue. +- !python {model: project.issue}: | self.case_open(cr, uid, [ref("project_issue_stockmovedates0")], {"lang": "en_US", "active_ids": [ref("project_issue.menu_project_issue_track")], "tz": False, "active_model": "ir.ui.menu", "search_default_project_id": False, "search_default_my_bugs": 1, "search_default_user_id": 1, "search_default_current_bugs": 1, "project_id": False, "active_id": ref("project_issue.menu_project_issue_track"), }) -- - Check if issue in 'open' state +- + I check if issue in 'open' state. - !assert {model: project.issue, id: project_issue_stockmovedates0, severity: error, string: Issue is in open state}: - state == 'open' -- - Keep issue pending -- +- + Keep issue pending. +- !python {model: project.issue}: | self.case_pending(cr, uid, [ref("project_issue_stockmovedates0")], {"lang": "en_US", "active_ids": [ref("project_issue.menu_project_issue_track")], @@ -47,37 +47,37 @@ False, "search_default_my_bugs": 1, "search_default_user_id": 1, "search_default_current_bugs": 1, "project_id": False, "active_id": ref("project_issue.menu_project_issue_track"), }) -- - Keep issue in 'Escalate' state -- +- + Keep issue in 'Escalate' state. +- !python {model: project.issue}: | self.case_escalate(cr, uid, [ref("project_issue_stockmovedates0")],{"lang": "en_US", "active_ids": [ref("project_issue.menu_project_issue_track")], "tz": False, "active_model": "ir.ui.menu", "search_default_project_id": False, "search_default_my_bugs": 1, "search_default_user_id": 1, "search_default_current_bugs": 1, "project_id": False, "active_id": ref("project_issue.menu_project_issue_track"), }) -- - Check if issue in 'Escalate' state +- + I check if issue in 'Escalate' state. - !assert {model: project.issue, id: project_issue_stockmovedates0, severity: error, string: Issue is in pending state}: - state == 'pending' -- - Open the issue -- +- + I open the issue. +- !python {model: project.issue}: | self.case_open(cr, uid, [ref("project_issue_stockmovedates0")], {"lang": "en_US", "active_ids": [ref("project_issue.menu_project_issue_track")], "tz": False, "active_model": "ir.ui.menu", "search_default_project_id": False, "search_default_my_bugs": 1, "search_default_user_id": 1, "search_default_current_bugs": 1, "project_id": False, "active_id": ref("project_issue.menu_project_issue_track"), }) -- - Check if issue in 'open' state +- + I check if issue in 'open' state. - !assert {model: project.issue, id: project_issue_stockmovedates0, severity: error, string: Issue is in open state}: - state == 'open' -- - Cancel the issue -- +- + I cancel the issue. +- !python {model: project.issue}: | self.case_cancel(cr, uid, [ref("project_issue_stockmovedates0")], {"lang": "en_US", "active_ids": [ref("project_issue.menu_project_issue_track")], @@ -85,14 +85,14 @@ False, "search_default_my_bugs": 1, "search_default_user_id": 1, "search_default_current_bugs": 1, "project_id": False, "active_id": ref("project_issue.menu_project_issue_track"), }) -- - Check if issue in 'cancel' state +- + I check if issue in 'cancel' state. - !assert {model: project.issue, id: project_issue_stockmovedates0, severity: error, string: Issue is in cancel state}: - state == 'cancel' -- - Reset the issue -- +- + Now, reset the issue. +- !python {model: project.issue}: | self.case_reset(cr, uid, [ref("project_issue_stockmovedates0")], {"lang": "en_US", "active_ids": [ref("project_issue.menu_project_issue_track")], @@ -100,14 +100,14 @@ False, "search_default_my_bugs": 1, "search_default_user_id": 1, "search_default_current_bugs": 1, "project_id": False, "active_id": ref("project_issue.menu_project_issue_track"), }) -- - Check if issue in 'draft' state +- + I check if issue in 'draft' state. - !assert {model: project.issue, id: project_issue_stockmovedates0, severity: error, string: Issue is in draft state}: - state == 'draft' -- - Close the issue -- +- + I close the issue. +- !python {model: project.issue}: | self.case_close(cr, uid, [ref("project_issue_stockmovedates0")], {"lang": "en_US", "active_ids": [ref("project_issue.menu_project_issue_track")], @@ -115,8 +115,8 @@ False, "search_default_my_bugs": 1, "search_default_user_id": 1, "search_default_current_bugs": 1, "project_id": False, "active_id": ref("project_issue.menu_project_issue_track"), }) -- - Check if issue in 'done' state +- + I check if issue in 'done' state. - !assert {model: project.issue, id: project_issue_stockmovedates0, severity: error, string: Issue is in done state}: - state == 'done' diff --git a/addons/project_long_term/test/phase_constraint.yml b/addons/project_long_term/test/phase_constraint.yml index af15fc1a165..ff0f847fefb 100644 --- a/addons/project_long_term/test/phase_constraint.yml +++ b/addons/project_long_term/test/phase_constraint.yml @@ -11,7 +11,7 @@ name: "from Monday to Friday, from 9am to 17pm" - - I have set Day1 Working Time for Monday to Friday from 9am to 17pm working hour + I have set Day1 Working Time for Monday to Friday from 9am to 17pm working hour. - !record {model: resource.calendar.attendance, id: resource_calendar_atendanceday1}: name: "Day1" @@ -21,7 +21,7 @@ calendar_id : resource_calendar_hoursweeks0 - - I have set Day2 Working Time for Monday to Friday from 9am to 17pm working hour + I have set Day2 Working Time for Monday to Friday from 9am to 17pm working hour. - !record {model: resource.calendar.attendance, id: resource_calendar_atendanceday1}: name: "Day2" @@ -31,7 +31,7 @@ calendar_id : resource_calendar_hoursweeks0 - - I have set Day3 Working Time for Monday to Friday from 9am to 17pm working hour + I have set Day3 Working Time for Monday to Friday from 9am to 17pm working hour. - !record {model: resource.calendar.attendance, id: resource_calendar_atendanceday1}: name: "Day3" @@ -41,7 +41,7 @@ calendar_id : resource_calendar_hoursweeks0 - - I have set Day4 Working Time for Monday to Friday from 9am to 17pm working hour + I have set Day4 Working Time for Monday to Friday from 9am to 17pm working hour. - !record {model: resource.calendar.attendance, id: resource_calendar_atendanceday1}: name: "Day4" @@ -51,7 +51,7 @@ calendar_id : resource_calendar_hoursweeks0 - - I have set Day5 Working Time for Monday to Friday from 9am to 17pm working hour + I have set Day5 Working Time for Monday to Friday from 9am to 17pm working hour. - !record {model: resource.calendar.attendance, id: resource_calendar_atendanceday1}: name: "Day5" @@ -62,7 +62,7 @@ - - Now Set working period to Project 'Develop yaml Project Module' + Now Set working period to Project 'Develop yaml Project Module'. - !python {model: project.project}: | context.update({'resource_calendar_id': ref("resource_calendar_hoursweeks0")}) @@ -76,7 +76,7 @@ self.compute_allocation(cr, uid, [ref('project_project_developyamlproject0')], start_date, end_date, context) self.generate_members(cr, uid, [ref('project_project_developyamlproject0')], context=None) - - Creating 3 consecutive 5-days phases. + I create 3 consecutive 5-days phases. For that Creating a Analyst Human resource to analyst Project Yaml. - !record {model: resource.resource, id: resource_resource_analyst1}: @@ -87,7 +87,7 @@ user_id: base.user_admin - - Creating Developer Human resource who develop Yaml + I create Developer Human resource who develop Yaml. - !record {model: resource.resource, id: resource_resource_develop0}: calendar_id: project_long_term.resource_calendar_hoursweeks0 @@ -96,7 +96,7 @@ time_efficiency: 1.0 user_id: base.user_admin - - Creating a Tester Human resource for testing Yaml + I create a Tester Human resource for testing Yaml. - !record {model: resource.resource, id: resource_resource_tester1}: calendar_id: project_long_term.resource_calendar_hoursweeks0 @@ -106,9 +106,9 @@ user_id: base.user_admin - - Create 3 a project phase and NO one depends on other one. + I create 3 a project phase and NO one depends on other one. so,they should start on the same day. - Creating First 'Analysis Flow for Yaml' Project Phase. + I create First 'Analysis Flow for Yaml' Project Phase. - !record {model: project.phase, id: project_phase_analysisflowforyaml0}: date_start: !eval time.strftime('%Y-%m-%d') @@ -120,7 +120,7 @@ state: draft - - I update the Constrain Date Start adn Date End for phase Analysis Flow for Yaml + I update the Constrain Date Start adn Date End for phase Analysis Flow for Yaml. - !python {model : project.phase }: | import datetime @@ -130,7 +130,7 @@ self.write(cr,uid, [(ref("project_phase_analysisflowforyaml0"))], {'constraint_date_start': start, 'constraint_date_end':end}) - - Create project phase 'Develop yaml' with constraint date. + I create project phase 'Develop yaml' with constraint date. - !record {model: project.phase, id: project_phase_developyaml0}: duration: 6.0 @@ -142,7 +142,7 @@ - project_phase_analysisflowforyaml0 - - I update the Constrain Date Start adn Date End for phase Develop yaml + I update the Constrain Date Start adn Date End for phase Develop yaml. - !python {model : project.phase }: | import datetime @@ -152,7 +152,7 @@ self._get_default_uom_id(cr, uid) self.write(cr,uid, [(ref("project_phase_developyaml0"))], {'constraint_date_start': start, 'constraint_date_end':end}) - - Create project phase 'Test Yaml' + I create project phase 'Test Yaml'. - !record {model: project.phase, id: project_phase_testyaml0}: duration: 6.0 @@ -164,20 +164,20 @@ constraint_date_start : constraint_date_end : - - Compute Schedule of phases For One project + I compute Schedule of phases For One project. - !record {model: project.compute.phases, id: project_compute_phases_0}: project_id: project_project_developyamlproject0 target_project: one - - Schedule project phases using "Compute Phase Scheduling" + I schedule project phases using "Compute Phase Scheduling". - !python {model: project.project}: | self.schedule_phases(cr, uid, [ref("project_project_developyamlproject0")]) - - After scheduling,check that + After scheduling,check that. Phase "Analysis Flow for Yaml" and "Test Yaml" Phase should start on the project start date while "Develop yaml" Phase should respect the constraint. - !python {model: project.project}: | @@ -187,18 +187,18 @@ if phase1.id != phase.id and phase.constraint_date_start == phase1.date_start: raise AssertionError("Phases not scheduled") - - Now, I am Checking constraint start and end for Phase 'Develop Yaml' + Now, I am Checking constraint start and end for Phase 'Develop Yaml'. - !python {model: project.phase}: | self._check_constraint_start(cr, uid, [ref("project_phase_developyaml0")],context) self._check_constraint_end(cr, uid, [ref("project_phase_developyaml0")],context) - - I am opening the Phase 'Develop Yaml' + I am opening the Phase 'Develop Yaml'. - !python {model: project.phase}: | self.set_open(cr, uid, [ref("project_phase_developyaml0")]) - - Now, Compute the Total Hours + Now, Compute the Total Hours. - !python {model: project.phase}: | field_name = 'test' @@ -206,7 +206,7 @@ self._compute(cr, uid, [ref("project_phase_developyaml0")], field_name, arg, context=None) - - Now, change the partner if needed + Now, change the partner if needed. - !python {model: project.phase}: | for project in self.browse(cr, uid, [ref('project_phase_developyaml0')], context): @@ -236,12 +236,12 @@ except: pass - - I am Postponding the Phase 'Develop Yaml' So Setting State to Pending + I am Postponding the Phase 'Develop Yaml' So Setting State to Pending. - !python {model: project.phase}: | self.set_pending(cr, uid, [ref("project_phase_developyaml0")]) - - Now, Done the Phase 'Develop Yaml' + Now, Done the Phase 'Develop Yaml'. - !python {model: project.phase}: | self.set_done(cr, uid, [ref("project_phase_developyaml0")]) @@ -250,4 +250,3 @@ - !python {model: project.phase}: | self.set_cancel(cr, uid, [ref("project_phase_developyaml0")]) - diff --git a/addons/project_long_term/test/project_schedule_consecutive_day.yml b/addons/project_long_term/test/project_schedule_consecutive_day.yml index 22604773aeb..bb2671af1d3 100644 --- a/addons/project_long_term/test/project_schedule_consecutive_day.yml +++ b/addons/project_long_term/test/project_schedule_consecutive_day.yml @@ -1,19 +1,19 @@ -- - Create a project 'Develop yaml Project Module'. -- +- + I create a project 'Develop yaml Project Module'. +- !record {model: project.project, id: project_project_developyamlproject_2}: name: "Develop Yaml Project Module" date_start: !eval time.strftime('%Y-%m-%d') -- +- I have set Working Time from Monday to Friday from 9am to 17pm. -- +- !record {model: resource.calendar, id: resource_calendar_hoursweekstest_P2}: name: "from Monday to Friday, from 9am to 17pm" -- - I have set Day1 Working Time for Monday to Friday from 9am to 17pm working hour -- +- + I have set Day1 Working Time for Monday to Friday from 9am to 17pm working hour. +- !record {model: resource.calendar.attendance, id: resource_calendar_hoursweekstest_P2day1}: name: "Day1" hour_from : 09.00 @@ -21,29 +21,29 @@ dayofweek : "0" calendar_id : resource_calendar_hoursweekstest_P2 -- - I have set Day2 Working Time for Monday to Friday from 9am to 17pm working hour -- +- + I have set Day2 Working Time for Monday to Friday from 9am to 17pm working hour. +- !record {model: resource.calendar.attendance, id: rresource_calendar_hoursweekstest_P2day2}: name: "Day2" hour_from : 09.00 hour_to : 17.00 dayofweek : "1" calendar_id : resource_calendar_hoursweekstest_P2 - -- - I have set Day3 Working Time for Monday to Friday from 9am to 17pm working hour -- + +- + I have set Day3 Working Time for Monday to Friday from 9am to 17pm working hour. +- !record {model: resource.calendar.attendance, id: resource_calendar_hoursweekstest_P2day3}: name: "Day3" hour_from : 09.00 hour_to : 17.00 - dayofweek : "2" + dayofweek : "2" calendar_id : resource_calendar_hoursweekstest_P2 -- - I have set Day4 Working Time for Monday to Friday from 9am to 17pm working hour -- +- + I have set Day4 Working Time for Monday to Friday from 9am to 17pm working hour. +- !record {model: resource.calendar.attendance, id: resource_calendar_hoursweekstest_P2day4}: name: "Day4" hour_from: 09.00 @@ -51,8 +51,8 @@ dayofweek: "3" calendar_id: resource_calendar_hoursweekstest_P2 -- - I have set Day5 Working Time for Monday to Friday from 9am to 17pm working hour +- + I have set Day5 Working Time for Monday to Friday from 9am to 17pm working hour. - !record {model: resource.calendar.attendance, id: resource_calendar_hoursweekstest_P2day5}: name: "Day5" @@ -61,16 +61,16 @@ dayofweek: "4" calendar_id: resource_calendar_hoursweekstest_P2 -- - Now Set working period to Project 'Develop yaml Project Module' -- - !python {model: project.project}: | +- + Now Set working period to Project 'Develop yaml Project Module'. +- + !python {model: project.project}: | self.write(cr, uid, [ref("project_project_developyamlproject_2")], {'resource_calendar_id': ref("resource_calendar_hoursweekstest_P2")}) -- - Create 3 a project phase. - First 'Analysis Flow for Yaml'Project Phase -- +- + I create 3 a project phase. + First 'Analysis Flow for Yaml'Project Phase. +- !record {model: project.phase, id: project_project_developyamlproject_2_Phase1}: date_start: !eval time.strftime('%Y-%m-%d') duration: 5.0 @@ -78,10 +78,10 @@ product_uom: product.uom_day project_id: project_project_developyamlproject_2 state: draft - -- - Create project phase 'Develop yaml' -- + +- + I create project phase 'Develop yaml'. +- !record {model: project.phase, id: project_project_developyamlproject_2_Phase2}: duration: 5.0 name: Develop Yaml @@ -89,31 +89,31 @@ project_id: project_project_developyamlproject_2 previous_phase_ids: - project_project_developyamlproject_2_Phase1 - -- - Create project phase 'Test Yaml' -- + +- + I create project phase 'Test Yaml'. +- !record {model: project.phase, id: project_project_developyamlproject_2_Phase3}: duration: 5.0 name: Testing Yaml product_uom: product.uom_day project_id: project_project_developyamlproject_2 previous_phase_ids: - - project_project_developyamlproject_2_Phase2 - -- - Compute Schedule of phases For One project -- + - project_project_developyamlproject_2_Phase2 + +- + I compute Schedule of phases For One project. +- !record {model: project.compute.phases, id: project_compute_phases_0}: project_id: project_project_developyamlproject_2 target_project: one - -- - Schedule project phases using Compute Phase Scheduling -- + +- + I schedule project phases using Compute Phase Scheduling. +- !python {model: project.project}: | self.schedule_phases(cr, uid, [ref("project_project_developyamlproject_2")]) - + - After scheduling, Check that phases scheduled, check that either of phase's start_date, end_date not null. - @@ -121,18 +121,17 @@ proj=self.browse(cr, uid, [ref("project_project_developyamlproject_2")])[0] for phase in proj.phase_ids: if (not phase.responsible_id) or (not phase.date_start) or (not phase.date_end): - raise AssertionError("Phases not scheduled") + raise AssertionError("Phases not scheduled") -- - Schedule the task -- +- + I schedule the task. +- !record {model: project.schedule.tasks, id: project_schedule_tasks_0}: msg: Task Scheduling Completed Successfully - -- - Compute date and Phase Scheduling -- - !python {model: project.schedule.tasks}: | - self.default_get(cr, uid, fields_list = {}, context=None) - self.compute_date(cr, uid, context=None) +- + I compute date and Phase Scheduling. +- + !python {model: project.schedule.tasks}: | + self.default_get(cr, uid, fields_list = {}, context=None) + self.compute_date(cr, uid, context=None) diff --git a/addons/project_long_term/test/project_schedule_without_wroking_hour.yml b/addons/project_long_term/test/project_schedule_without_wroking_hour.yml index 61a8539585a..e372d5d2025 100644 --- a/addons/project_long_term/test/project_schedule_without_wroking_hour.yml +++ b/addons/project_long_term/test/project_schedule_without_wroking_hour.yml @@ -1,14 +1,14 @@ - - Create a project 'Develop yaml Implementation Module'. + I create a project 'Develop yaml Implementation Module'. - !record {model: project.project, id: project_project_developyamlproject_2}: name: "Develop Yaml Project Module" date_start: !eval time.strftime('%Y-%m-%d') -- - Create 4 Project phase. - First Project Phase 'Analysis Flow for Yaml' -- +- + I create 4 Project phase. + First Project Phase 'Analysis Flow for Yaml'. +- !record {model: project.phase, id: project_project_developyamlproject_2_phase_1}: date_start: !eval time.strftime('%Y-%m-%d') duration: 6.0 @@ -17,10 +17,10 @@ project_id: project_project_developyamlproject_2 responsible_id: project.res_users_analyst state: draft - -- - Create project phase 'Develop yaml' -- + +- + I create project phase 'Develop yaml'. +- !record {model: project.phase, id: project_project_developyamlproject_2_phase_2}: duration: 6.0 name: "Develop yaml" @@ -29,42 +29,42 @@ previous_phase_ids: - project_project_developyamlproject_2_phase_1 state: draft -- - Create project phase 'Test Yaml' -- +- + I create project phase 'Test Yaml'. +- !record {model: project.phase, id: project_project_developyamlproject_2_phase_3}: duration: 6.0 name: Testing Yaml product_uom: product.uom_day project_id: project_project_developyamlproject_2 previous_phase_ids: - - project_project_developyamlproject_2_phase_2 + - project_project_developyamlproject_2_phase_2 state: draft -- - Create project phase 'Implement Yaml' -- +- + I create project phase 'Implement Yaml'. +- !record {model: project.phase, id: project_project_developyamlproject_2_phase_4}: duration: 6.0 name: Testing Yaml product_uom: product.uom_day project_id: project_project_developyamlproject_2 previous_phase_ids: - - project_project_developyamlproject_2_phase_3 + - project_project_developyamlproject_2_phase_3 state: draft -- - Compute Schedule of phases For One project -- +- + I compute Schedule of phases For One project . +- !record {model: project.compute.phases, id: project_compute_phases_0}: project_id: project_project_developyamlproject_2 target_project: one - -- - Schedule project phases using Compute Phase Scheduling -- + +- + I schedule project phases using Compute Phase Scheduling. +- !python {model: project.project}: | self.schedule_phases(cr, uid, [ref("project_project_developyamlproject_2")]) - + - After scheduling, Check that phases scheduled, check that either of phase's start_date, end_date not null. - @@ -72,6 +72,4 @@ proj=self.browse(cr, uid, [ref("project_project_developyamlproject_2")])[0] for phase in proj.phase_ids: if (not phase.responsible_id) or (not phase.date_start) or (not phase.date_end): - raise AssertionError("Phases not scheduled") - - + raise AssertionError("Phases not scheduled") diff --git a/addons/project_long_term/test/schedule_phase_tasks.yml b/addons/project_long_term/test/schedule_phase_tasks.yml index 734eef7c974..db97351e9cd 100644 --- a/addons/project_long_term/test/schedule_phase_tasks.yml +++ b/addons/project_long_term/test/schedule_phase_tasks.yml @@ -1,5 +1,5 @@ - - Create project 'Develop an outlook-openerp synchronization plugin' + I create project 'Develop an outlook-openerp synchronization plugin'. - !record {model: project.project, id: project_project_project4}: name: Develop an outlook-openerp synchronization plugin @@ -12,7 +12,7 @@ - project.res_users_analyst - project.res_users_finacial_manager - - Create phase 'Develop GUI' in Outlook + I create phase 'Develop GUI' in Outlook. - !record {model: project.phase, id: project_phase_phase0}: date_start: !eval time.strftime("%Y-%m-%d") @@ -29,7 +29,7 @@ - resource_id: project_long_term.resource_project_manager - - Create the phase task 'Develop GUI for Server Configuration' + I create the phase task 'Develop GUI for Server Configuration'. - !record {model: project.task, id: project_task_t0}: name: Develop GUI for Server Configuration @@ -41,7 +41,7 @@ - - Create the phase task 'Develop GUI for Modules Configuration' + I create the phase task 'Develop GUI for Modules Configuration'. - !record {model: project.task, id: project_task_t1}: name: Develop GUI for Modules Configuration @@ -52,7 +52,7 @@ project_id: project_project_project4 - - Create the phase task 'Develop GUI for OpenERP Synchronisation' + I create the phase task 'Develop GUI for OpenERP Synchronisation'. - !record {model: project.task, id: project_task_t2}: name: Develop GUI for OpenERP Synchronisation @@ -63,7 +63,7 @@ project_id: project_project_project4 - - Create the phase task 'Design required GUI/Menus' + I create the phase task 'Design required GUI/Menus'. - !record {model: project.task, id: project_task_3}: name: Design required GUI/Menus @@ -74,13 +74,13 @@ project_id: project_project_project4 - - Schedule phase tasks + Schedule phase tasks. - !python {model: project.phase}: | res = self.schedule_tasks(cr, uid, [ref("project_phase_phase0")]) - - Check if tasks scheduled, check that either of task's start_date, end_date and user_id is not null + I check if tasks scheduled, check that either of task's start_date, end_date and user_id is not null. - !python {model: project.phase}: | phase = self.browse(cr, uid, [ref("project_phase_phase0")])[0] diff --git a/addons/project_long_term/test/schedule_project_phases.yml b/addons/project_long_term/test/schedule_project_phases.yml index 8da1d4d124b..a05ec1c31f8 100644 --- a/addons/project_long_term/test/schedule_project_phases.yml +++ b/addons/project_long_term/test/schedule_project_phases.yml @@ -1,5 +1,5 @@ - - Create a project 'World Bank's Project' + I create a project 'World Bank's Project'. - !record {model: project.project, id: project_project_worldbanksproject0}: name: "World Bank's Project" @@ -13,7 +13,7 @@ - project.res_users_tester - - Create a project phase 'Defining Client's Basic Idea of Project' + I create a project phase 'Defining Client's Basic Idea of Project'. - !record {model: project.phase, id: project_phase_definingclientsbasicideaofproject0}: date_start: !eval time.strftime('%Y-%m-%d') @@ -23,7 +23,7 @@ project_id: project_project_worldbanksproject0 - - Create project phase 'Establishing Project Feasibility' + I create project phase 'Establishing Project Feasibility'. - !record {model: project.phase, id: project_phase_establishingprojectfeasibility0}: date_start: !eval time.strftime('%Y-%m-%d') @@ -39,7 +39,7 @@ resource_id: project_long_term.resource_project_manager phase_id: project_phase_definingclientsbasicideaofproject0 - - call get_name function + call get_name function. - !python {model: project.resource.allocation}: | arg={} @@ -62,7 +62,7 @@ phase_id: project_phase_definingclientsbasicideaofproject0 - - Create the phase task 'Develop GUI for Server Configuration' + I create the phase task 'Develop GUI for Server Configuration'. - !record {model: project.task, id: project_task_t0}: name: Develop GUI for Server Configuration @@ -72,7 +72,7 @@ project_id: project_project_worldbanksproject0 - - Create the phase task 'Develop GUI for Modules Configuration' + I create the phase task 'Develop GUI for Modules Configuration'. - !record {model: project.task, id: project_task_t1}: name: Develop GUI for Modules Configuration @@ -83,7 +83,7 @@ project_id: project_project_worldbanksproject0 - - Create project phase 'Preparation of Engineering Designs' + I create project phase 'Preparation of Engineering Designs'. - !record {model: project.phase, id: project_phase_preparationofengineeringdesigns0}: date_start: !eval time.strftime('%Y-%m-%d') @@ -107,7 +107,7 @@ phase_id: project_phase_preparationofengineeringdesigns0 - - Create the phase task 'Develop GUI for Client Configuration' + I create the phase task 'Develop GUI for Client Configuration'. - !record {model: project.task, id: project_task_t2}: name: Develop GUI for Server Configuration @@ -118,7 +118,7 @@ project_id: project_project_worldbanksproject0 - - Create the phase task 'Develop GUI for Client Module Configuration' + I create the phase task 'Develop GUI for Client Module Configuration'. - !record {model: project.task, id: project_task_t3}: name: Develop GUI for Modules Configuration @@ -130,7 +130,7 @@ - - Create project phase 'Procurement of Works and Goods' + I create project phase 'Procurement of Works and Goods'. - !record {model: project.phase, id: project_phase_procurementofworksandgoods0}: date_start: !eval time.strftime('%Y-%m-%d') @@ -140,7 +140,7 @@ project_id: project_project_worldbanksproject0 - - Create project phase 'Project Construction' + I create project phase 'Project Construction'. - !record {model: project.phase, id: project_phase_projectconstruction0}: date_start: !eval time.strftime('%Y-%m-%d') @@ -151,7 +151,7 @@ - - Create project phase 'Project Completion' + I create project phase 'Project Completion'. - !record {model: project.phase, id: project_phase_projectcompletion0}: date_start: !eval time.strftime('%Y-%m-%d') @@ -161,7 +161,7 @@ project_id: project_project_worldbanksproject0 - - Set previous phase for phase 'Establishing Project Feasibility' + I set previous phase for phase 'Establishing Project Feasibility'. - !record {model: project.phase, id: project_phase_establishingprojectfeasibility0}: previous_phase_ids: @@ -169,21 +169,21 @@ - - Set previous phase for phase 'Preparation of Engineering Designs' + I set previous phase for phase 'Preparation of Engineering Designs'. - !record {model: project.phase, id: project_phase_preparationofengineeringdesigns0}: previous_phase_ids: - project_phase_establishingprojectfeasibility0 - - Set previous phase for phase 'Procurement of Works and Goods' + I set previous phase for phase 'Procurement of Works and Goods'. - !record {model: project.phase, id: project_phase_procurementofworksandgoods0}: previous_phase_ids: - project_phase_preparationofengineeringdesigns0 - - Set previous phase for phase 'Project Construction' + I set previous phase for phase 'Project Construction'. - !record {model: project.phase, id: project_phase_projectconstruction0}: previous_phase_ids: @@ -191,7 +191,7 @@ - - Set previous phase for phase 'Project Completion' + I set previous phase for phase 'Project Completion'. - !record {model: project.phase, id: project_phase_projectcompletion0}: previous_phase_ids: @@ -199,7 +199,7 @@ - - Get the project to schedule phases + I get the project to schedule phases. - !record {model: project.compute.phases, id: project_compute_phases_0}: project_id: project_project_worldbanksproject0 @@ -207,18 +207,16 @@ - - Schedule project phases + I schedule project phases. - !python {model: project.project}: | self.schedule_phases(cr, uid, ref("project_project_worldbanksproject0")) - - Check if phases scheduled, check that either of phase's start_date, end_date and user_id is not null + I check if phases scheduled, check that either of phase's start_date, end_date and user_id is not null. - !python {model: project.project}: | prj=self.browse(cr, uid, [ref("project_project_worldbanksproject0")])[0] for phase in prj.phase_ids: if (not phase.responsible_id) or (not phase.date_start) or (not phase.date_end): raise AssertionError("Tasks not scheduled") - - diff --git a/addons/project_long_term/test/schedule_project_tasks.yml b/addons/project_long_term/test/schedule_project_tasks.yml index 825b7c404d9..e10fde534f8 100644 --- a/addons/project_long_term/test/schedule_project_tasks.yml +++ b/addons/project_long_term/test/schedule_project_tasks.yml @@ -1,6 +1,6 @@ -- - Create project 'Develop a thunderbird-openerp synchronization plugin' -- +- + I create project 'Develop a thunderbird-openerp synchronization plugin'. +- !record {model: project.project, id: project_project_project1}: name: Develop a thunderbird-openerp synchronization plugin members: @@ -11,10 +11,10 @@ - project.res_users_tester - project.res_users_analyst - project.res_users_finacial_manager - -- - Create phase 'Develop GUI' in thunderbird -- + +- + I create phase 'Develop GUI' in thunderbird. +- !record {model: project.phase, id: project_phase_phase1}: date_start: !eval time.strftime('%Y-%m-%d') duration: 200.0 @@ -29,11 +29,11 @@ useability: 30.0 - resource_id: project_long_term.resource_designer useability: 30.0 - - -- - Create the phase task 'Develop GUI for Server Configuration' -- + + +- + I create the phase task 'Develop GUI for Server Configuration'. +- !record {model: project.task, id: project_task_t10}: name: Develop GUI for Server Configuration planned_hours: 20.0 @@ -42,10 +42,10 @@ phase_id: project_phase_phase1 project_id: project_project_project1 user_id: project.res_users_developer - -- - Create the phase task 'Develop GUI for Modules Configuration' -- + +- + I create the phase task 'Develop GUI for Modules Configuration'. +- !record {model: project.task, id: project_task_t11}: name: Develop GUI for Modules Configuration planned_hours: 25.0 @@ -54,9 +54,9 @@ phase_id: project_phase_phase1 project_id: project_project_project1 user_id: project.res_users_developer -- - Create the phase task 'Develop GUI for OpenERP Synchronisation' -- +- + I create the phase task 'Develop GUI for OpenERP Synchronisation'. +- !record {model: project.task, id: project_task_t12}: name: Develop GUI for OpenERP Synchronisation planned_hours: 30.0 @@ -65,9 +65,9 @@ phase_id: project_phase_phase1 project_id: project_project_project1 user_id: project.res_users_developer -- - Create the phase task 'Design required GUI/Menus' -- +- + I create the phase task 'Design required GUI/Menus'. +- !record {model: project.task, id: project_task_13}: name: Design required GUI/Menus planned_hours: 25.0 @@ -76,16 +76,16 @@ phase_id: project_phase_phase1 project_id: project_project_project1 user_id: project.res_users_designer - - -- - Schedule tasks -- + + +- + I schedule tasks. +- !python {model: project.project}: | self.schedule_tasks(cr, uid, ref("project_project_project1")) - - Check if tasks scheduled, check that either of task's start_date, end_date and user_id is not null + I check if tasks scheduled, check that either of task's start_date, end_date and user_id is not null. - !python {model: project.project}: | prj = self.browse(cr, uid, [ref("project_project_project1")])[0] diff --git a/addons/project_long_term/test/test_schedule_phases_case1.yml b/addons/project_long_term/test/test_schedule_phases_case1.yml index d02082d989a..cd80318af24 100644 --- a/addons/project_long_term/test/test_schedule_phases_case1.yml +++ b/addons/project_long_term/test/test_schedule_phases_case1.yml @@ -3,7 +3,7 @@ test it with two different dates for scheduling. - I create a project Development and Testing. -- +- !record {model: project.project, id: project_project_project_case1}: name: "Development and Testing" date_start: !eval time.strftime('%Y-%m-%d') @@ -25,18 +25,18 @@ - project.project_tt_development - project.project_tt_testing - project.project_tt_merge -- +- I create first phase of the project. -- +- !record {model: project.phase, id: project_phase_firstphase0_case1}: duration: 2.0 name: First Phase product_uom: product.uom_day project_id: project_project_project_case1 state: draft -- +- I create second phase of the project. -- +- !record {model: project.phase, id: project_phase_secondphase0_case2}: duration: 3.0 name: Second Phase diff --git a/addons/project_long_term/test/test_schedule_phases_case2.yml b/addons/project_long_term/test/test_schedule_phases_case2.yml index 67a7332cf5b..c438607ea56 100644 --- a/addons/project_long_term/test/test_schedule_phases_case2.yml +++ b/addons/project_long_term/test/test_schedule_phases_case2.yml @@ -1,9 +1,9 @@ - - In order to test scheduling of project phases, I create two different + In order to test scheduling of project phases, I create two different working periods and resources. And schedule the phases. -- +- I create first working period 'Working Time A'. -- +- !record {model: resource.calendar, id: resource_calendar_workingtimea0}: attendance_ids: - dayofweek: '0' @@ -24,45 +24,45 @@ name: Thursday name: Working Time A -- - Creating a resource.calendar.attendance record -- +- + I create a resource.calendar.attendance record. +- !record {model: resource.calendar.attendance, id: resource_calendar_attendance_monday0}: calendar_id: resource_calendar_workingtimea0 dayofweek: '0' hour_from: 10.0 hour_to: 16.0 name: Monday -- - Creating a resource.calendar.attendance record -- +- + I create a resource.calendar.attendance record. +- !record {model: resource.calendar.attendance, id: resource_calendar_attendance_tuesday0}: calendar_id: resource_calendar_workingtimea0 dayofweek: '1' hour_from: 10.0 hour_to: 16.0 name: Tuesday -- - Creating a resource.calendar.attendance record -- +- + I create a resource.calendar.attendance record. +- !record {model: resource.calendar.attendance, id: resource_calendar_attendance_wednesday0}: calendar_id: resource_calendar_workingtimea0 dayofweek: '2' hour_from: 10.0 hour_to: 16.0 name: Wednesday -- - Creating a resource.calendar.attendance record -- +- + I create a resource.calendar.attendance record. +- !record {model: resource.calendar.attendance, id: resource_calendar_attendance_thursday0}: calendar_id: resource_calendar_workingtimea0 dayofweek: '3' hour_from: 10.0 hour_to: 16.0 name: Thursday -- +- I create second working period 'Working Time B'. -- +- !record {model: resource.calendar, id: resource_calendar_workingtimeb0}: attendance_ids: - dayofweek: '4' @@ -70,35 +70,35 @@ hour_to: 18.0 name: Friday name: Working Time B -- - Creating a resource.calendar.attendance record -- +- + I create a resource.calendar.attendance record. +- !record {model: resource.calendar.attendance, id: resource_calendar_attendance_friday0}: calendar_id: resource_calendar_workingtimeb0 dayofweek: '4' hour_from: 9.0 hour_to: 18.0 name: Friday -- +- I create first resource say 'Resource X' without assigning working period. -- +- !record {model: resource.resource, id: resource_resource_resourcex0}: name: Resource X resource_type: user time_efficiency: 1.0 user_id: base.user_admin -- +- I create first resource say 'Resource Y' with working period 'Working Time B'. -- +- !record {model: resource.resource, id: resource_resource_resourcey0}: calendar_id: resource_calendar_workingtimeb0 name: Resource Y resource_type: user time_efficiency: 1.0 user_id: base.user_admin -- +- I create a project 'Development and Testing' and assign working period 'Working Time A'. -- +- !record {model: project.project, id: project_project_project0}: balance: 0.0 credit: 0.0 @@ -142,10 +142,10 @@ - project.project_tt_development - project.project_tt_testing - project.project_tt_merge - -- + +- I create a phase 'Initial Phase' for project 'Development and Testing'. -- +- !record {model: project.phase, id: project_phase_phase0}: date_start: '2011-01-03' duration: 0.0 @@ -153,9 +153,9 @@ product_uom: product.uom_day project_id: project_project_project0 state: draft -- +- I create first task 'Developing module' and assign 10h. -- +- !record {model: project.task, id: project_task_task0}: delay_hours: 0.0 effective_hours: 0.0 @@ -166,9 +166,9 @@ state: draft total_hours: 10.0 phase_id: project_phase_phase0 -- +- I create first task 'Testing module' and assign 10h. -- +- !record {model: project.task, id: project_task_task1}: delay_hours: 0.0 effective_hours: 0.0 @@ -190,4 +190,3 @@ - !python {model: project.compute.phases}: | self.check_selection(cr, uid, [ref("project_compute_phases0")]) -