From 0710d3b8d4b511df2cae2758c64e9cbb0301b97e Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Thu, 25 Aug 2011 11:14:58 +0530 Subject: [PATCH 01/36] [IMP]project : Improve the test cases bzr revid: dbr@tinyerp.com-20110825054458-48t8ynjmom1b7u74 --- addons/project/test/test_project.yml | 133 +++++++++++- .../project/test/test_project_delegation.yml | 195 +++++++++--------- 2 files changed, 231 insertions(+), 97 deletions(-) diff --git a/addons/project/test/test_project.yml b/addons/project/test/test_project.yml index f79c2a34224..43ad07abe05 100644 --- a/addons/project/test/test_project.yml +++ b/addons/project/test/test_project.yml @@ -1,5 +1,10 @@ - - Test project template feature + I assign an email address to Administrator. +- + !record {model: res.users, id: base.user_root}: + user_email: admin@openerp.com +- + Now, Test project template feature - Create project 'OpenERP Training Programme' - @@ -12,6 +17,7 @@ !record {model: project.task, id: project_task_technicaltraining0}: date_start: !eval time.strftime('%Y-%m-%d %H:%M:%S') name: Technical Training + user_id: base.user_root planned_hours: 30.0 project_id: project_project_openerptrainingprogramme0 remaining_hours: 30.0 @@ -26,6 +32,58 @@ project_id: project_project_openerptrainingprogramme0 remaining_hours: 30.0 state: draft +- + Set project's task view +- + !python {model: project.task}: | + self._default_project(cr, uid,context) + self.fields_view_get(cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False) +- + Check child project. +- + !python {model: project.task}: | + self._check_child_task(cr, uid, [ref("project_task_functionaltraining0")]) +- + Do some changes on project. +- + !python {model: project.task}: | + self.onchange_project(cr, uid, [ref("project_task_functionaltraining0")],ref('project_project_openerptrainingprogramme0')) +- + Change the type of project. +- + !python {model: project.task}: | + self._change_type(cr, uid,[ref("project_task_functionaltraining0")], next, context) +- + Click on next Button. +- + !python {model: project.task}: | + self.next_type(cr, uid,[ref("project_task_functionaltraining0")], context) +- + Click on previous Button. +- + !python {model: project.task}: | + self.prev_type(cr, uid,[ref("project_task_functionaltraining0")], context) +- + Create work for project's task. +- + !record {model: project.task.work, id: project_task_work0}: + name: Technical Training Task's Work + task_id: project_task_technicaltraining0 +- + Add project's Work +- + !python {model: project.task.work}: | + 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")}) +- + 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")}) +- + Change the project's partner if needed. +- + !python {model: project.project}: | + self.onchange_partner_id(cr, uid, [ref("project_project_openerptrainingprogramme0")], part=False, 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")}) - Set project as project template - @@ -101,7 +159,7 @@ "tz": False, "active_model": "ir.ui.menu", "project_id": False, "active_id": ref("project.menu_open_view_project_all"), }) - - 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" @@ -118,7 +176,17 @@ !record {model: project.task.reevaluate, id: project_task_technicaltraining_remainingwiz0}: remaining_hours: 30.0 - | - I click the apply button + Create the view for reevaluate the task. +- + !python {model: project.task.reevaluate}: | + self.fields_view_get(cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False) +- | + Now get the remaining hours required to close the task. +- + !python {model: project.task.reevaluate}: | + self._get_remaining(cr, uid) +- | + I click the apply button. - !python {model: project.task.reevaluate}: | self.compute_hours(cr, uid, [ref('project_task_technicaltraining_remainingwiz0')], {'active_id': ref("project_task_technicaltraining0"),'button_reactivate': True}) @@ -176,6 +244,11 @@ !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 +- + Create analytic account. +- + !record {model: account.analytic.account, id: account_analytic_account0}: + name : account_analytic_account - Set remaining hours of 10 hours for reevaluating the task - @@ -223,8 +296,6 @@ - !assert {model: project.task, id: project_task_technicaltraining0, severity: error, string: Task is in done state}: - state == "done" - - - Test for task reactivation - @@ -264,6 +335,11 @@ - planned_hours == 30 - remaining_hours == 5.0 - effective_hours == 45.0 +- + Check for remaining hours +- + !python {model: project.task}: | + self.onchange_remaining(cr, uid, [ref("project_task_functionaltraining0")], remaining = 0.0, planned = 0.0) - Close the task - @@ -293,4 +369,51 @@ - !assert {model: project.project, id: project_project_openerptrainingprogramme0, severity: error, string: "Project must be in closed state"}: - state == "close" +- + Unlink the task's work. +- + !python {model: project.task.work}: | + self.unlink(cr, uid, [ref('project_task_work0')]) +- + After remove project task's work unlink it's details from the analytic account. +- + !python {model: account.analytic.account}: | + self.unlink(cr, uid, [ref('account_analytic_account0')]) +- + Now, Close the project task +- + !record {model: project.task.close, id: project_task_close_0}: + manager_warn : True + partner_warn : False + manager_email : 'info@mycustomer.com' + partner_email : 'info@myinfobid.com' + description : Description +- + Send Warn Message by Email to Manager and Customer. +- + !python {model: project.task.close}: | + fields = { + 'manager_warn' : True, + 'partner_warn' : False, + 'manager_email' : 'info@mycustomer.com', + 'partner_email' : 'info@myinfobid.com', + 'description' : 'Description' + } + self.default_get(cr, uid, fields, context={"active_ids":[ref("project_task_technicaltraining0")],"active_id": ref("project_task_technicaltraining0")}) + self.send(cr, uid, [ref('project_task_close_0')], context={"active_ids":[ref("project_task_technicaltraining0")],"active_id": ref("project_task_technicaltraining0")}) +- + Close this project. +- + !python {model: project.task}: | + self.action_close(cr, uid, [ref("project_task_functionaltraining0")],context={"lang": "en_US", "active_ids": [ref("project_project_openerptrainingprogramme0")],"tz": False, "active_id": ref("project_project_openerptrainingprogramme0")}) +- + Cancel this project. +- + !python {model: project.task}: | + self.do_cancel(cr, uid,[ref("project_task_functionaltraining0")],context={}) +- + Unlink this project. +- + !python {model: project.task}: | + self.unlink(cr, uid,[ref("project_task_functionaltraining0")]) diff --git a/addons/project/test/test_project_delegation.yml b/addons/project/test/test_project_delegation.yml index 02bc9afaae8..730c019b701 100644 --- a/addons/project/test/test_project_delegation.yml +++ b/addons/project/test/test_project_delegation.yml @@ -1,115 +1,125 @@ - - 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. -- + 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 Documentation -- +- !record {model: project.project, id: project_project_openerpdocumentation0}: company_id: base.main_company - name: OpenERP Documentation - -- + name: OpenERP Documentation + +- 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_openerpdocumentation0 remaining_hours: 20.0 state: draft - -- - Open the task -- +- + 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"), }) + "tz": False, "active_id": ref("project.menu_action_view_task"), }) -- +- Creating a task 'Publish the References' -- +- !record {model: project.task, id: project_task_publish_book}: name: Publish the References planned_hours: 10.0 project_id: project_project_openerpdocumentation0 remaining_hours: 10.0 state: draft - -- - Open the task -- + +- + Open the task 'Publish the References' +- !python {model: project.task}: | self.do_open(cr, uid, [ref("project_task_publish_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"), }) + "tz": False, "active_id": ref("project.menu_action_view_task"), }) - - Test the delegate wizard -- + Test the delegate wizard +- Creating 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 - new_task_description: aaa + new_task_description: test_new_task planned_hours: 15.0 planned_hours_me: 1.0 prefix: 'CHECK: Publish the References' state: pending user_id: base.user_demo - -- - Validating the delegate task -- +- + Create view for delegate task. +- !python {model: project.task.delegate}: | - self.delegate(cr, uid, [ref("project_task_publish_book_delegate")], - {"lang": "en_US", "active_model": "project.task", "tz": False, "record_id": - 4, "active_ids": [ref("project_task_publish_book")], "active_id": ref("project_task_publish_book"), - }) - + fields = { + 'name' : 'Test', + 'new_task_description' : 'test_new_task', + 'planned_hours' : '15.0', + 'planned_hours_me' : '1.0', + 'prefix' : 'CHECK_Publish the References', + 'state' : 'pending', + 'user_id' : 'base.user_root' + } + context = {"lang": "en_US", "active_model": "project.task", "tz": False,"record_id":4, "active_ids": [ref("project_task_publish_book")], "active_id": ref("project_task_publish_book")} + 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) +- + Validating the delegate task. +- + !python {model: project.task.delegate}: | + self.delegate(cr, uid, [ref("project_task_publish_book_delegate")],context={"lang": "en_US", "active_model": "project.task", "tz": False,"record_id":4, "active_ids": [ref("project_task_publish_book")], "active_id": ref("project_task_publish_book")}) - 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" -- - Creating a delegate task 'Prepare a book that gives functional overview of OpenERP' -- + - state == "pending" +- + 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_openerpdocumentation0 remaining_hours: 30.0 state: draft - -- - Open the task -- + +- + 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")], {"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_openerpdocumentation0 remaining_hours: 30.0 state: draft - -- - Open the task -- + +- + 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")], {"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 @@ -117,20 +127,20 @@ 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_openerpdocumentation0 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 @@ -138,9 +148,9 @@ 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 @@ -148,83 +158,84 @@ planned_hours: 20.0 state: pending -- - Open the task -- +- + Open the task 'Prepare documentation for Business Process Development' +- !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 -- + +- + 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"), }) + "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 must be 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 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", "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 a book that gives functional overview of OpenERP' -- + +- + 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", "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 -- + +- + 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" + - state == "open" +- From 59712442ae36d2acc74947ac0fcf85a140f1b34f Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Thu, 25 Aug 2011 11:52:58 +0530 Subject: [PATCH 02/36] [IMP]project_gtd : Improve the test cases bzr revid: dbr@tinyerp.com-20110825062258-d5byv2jja8jz2gwn --- addons/project_gtd/test/gtd_test.yml | 63 +++++++++++++++++----------- 1 file changed, 38 insertions(+), 25 deletions(-) diff --git a/addons/project_gtd/test/gtd_test.yml b/addons/project_gtd/test/gtd_test.yml index 5c05dfd76cc..1d5e1032616 100644 --- a/addons/project_gtd/test/gtd_test.yml +++ b/addons/project_gtd/test/gtd_test.yml @@ -1,6 +1,8 @@ -- +- + Create concepts defined by the Getting Things Done methodology. +- Create a task 'Develop time management module' with monthly timebox -- +- !record {model: project.task, id: project_task_developtimemanagementmodule0}: name: Develop time management module planned_hours: 15.0 @@ -8,11 +10,14 @@ remaining_hours: 15.0 state: draft timebox_id: project_gtd.timebox_monthly - - -- - Open the task -- +- + Create view for 'Develop time management module'. +- + !python {model: project.task}: | + self.fields_view_get(cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False) +- + Open the 'Develop time management module' task +- !python {model: project.task}: | self.do_open(cr, uid, [ref("project_task_developtimemanagementmodule0")], {"lang": "en_US", "project_id": False, "tz": False, "active_model": "ir.ui.menu", @@ -20,47 +25,55 @@ False, "search_default_user_id": 1, "search_default_current": 1, "active_ids": [ref("project.menu_action_view_task")], "active_id": ref("project.menu_action_view_task"), }) - -- +- 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 -- +- !record {model: project.gtd.timebox, id: project_gtd_timebox_tomorrow1}: name: Tomorrow sequence: 0.0 - -- +- Planify the task from monthly timebox to tomorrow timebox -- +- !record {model: project.timebox.fill.plan, id: project_timebox_fill_plan_0}: task_ids: - project_task_developtimemanagementmodule0 timebox_id: project_gtd.timebox_monthly timebox_to_id: project_gtd_timebox_tomorrow1 - - -- +- Set the task to tomorrow timebox -- +- !python {model: project.timebox.fill.plan}: | self.process(cr, uid, [ref("project_timebox_fill_plan_0")], {"lang": "en_US", "project_id": False, "tz": False, "active_model": "project.gtd.timebox", "department_id": False, "section_id": False, "record_id": 1, "active_ids": [ref("project_gtd.timebox_daily")], "active_id": ref("project_gtd.timebox_daily"), }) - +- + Copy the task 'Develop time management module'. +- + !python {model: project.task}: | + self.copy_data(cr, uid, ref('project_task_developtimemanagementmodule0'), default=None, context=None) - 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") - +- + Click on Next button. +- + !python {model: project.task}: | + self.next_timebox(cr, uid, [ref('project_task_developtimemanagementmodule0')]) +- + Click on Previous button. +- + !python {model: project.task}: | + self.prev_timebox(cr, uid, [ref('project_task_developtimemanagementmodule0')]) - Empty Timebox for tomorrow - @@ -70,9 +83,9 @@ "department_id": False, "section_id": False, "record_id": 1, "active_ids": [ref("project_gtd_timebox_tomorrow1")], "active_id": ref("project_gtd_timebox_tomorrow1"), }) - - 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") \ No newline at end of file + !assert {model: project.task, id: project_task_developtimemanagementmodule0, string: Task is not in tomorrow timebox}: + - timebox_id.id != ref("project_gtd_timebox_tomorrow1") + From 88c05e6142535b5829a739cb747b739027468cd3 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Thu, 25 Aug 2011 14:39:06 +0530 Subject: [PATCH 03/36] [IMP]project_issue : Improve the test cases for convert_issue_to_task.yml bzr revid: dbr@tinyerp.com-20110825090906-akypz8jkzpnzb7qc --- .../test/convert_issue_to_task.yml | 91 ++++++++++++++++++- 1 file changed, 87 insertions(+), 4 deletions(-) diff --git a/addons/project_issue/test/convert_issue_to_task.yml b/addons/project_issue/test/convert_issue_to_task.yml index 13ddef69251..bba5d335458 100644 --- a/addons/project_issue/test/convert_issue_to_task.yml +++ b/addons/project_issue/test/convert_issue_to_task.yml @@ -1,21 +1,34 @@ - - Create an issue + 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') + name: Technical Training + user_id: base.user_root + planned_hours: 30.0 + project_id: project.project_project_22 + remaining_hours: 30.0 + state: draft +- + Create a project issue - !record {model: project.issue, id: project_issue_onchangeevent0}: categ_id: project_issue.bug_categ + date_open: !eval time.strftime('%Y-%m-%d') name: on_change event does not pass context to the method project_id: project.project_project_22 + task_id: project_task_training0 working_hours_close: 0.0 working_hours_open: 0.0 - - Check there is no task attached to issue + 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 - - Convert issue to task + Convert project issue to task - !python {model: project.issue}: | self.convert_issue_task(cr, uid, [ref("project_issue_onchangeevent0")], @@ -26,7 +39,77 @@ ref("project_issue.menu_project_issue_track"), }) - - Check there is a task attached to issue + 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 +- + !python {model: project.issue}: | + self._get_project(cr, uid, context) +- + Creat some changes on project +- + !python {model: project.issue}: | + self.on_change_project(cr, uid, [ref("project_issue_onchangeevent0")],context) +- + Go to next issue. +- + !python {model: project.issue}: | + self.next_type(cr, uid, [ref("project_issue_onchangeevent0")]) +- + Go to Previous issue. +- + !python {model: project.issue}: | + self.prev_type(cr, uid, [ref("project_issue_onchangeevent0")]) +- + 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. +- + !python {model: project.issue}: | + self.convert_to_feature(cr, uid, [ref("project_issue_onchangeevent0")]) +- + Convert Issue to Bug. +- + !python {model: project.issue}: | + self.convert_to_bug(cr, uid, [ref("project_issue_onchangeevent0")]) +- + Copy the issue. +- + !python {model: project.issue}: | + default=None + context=None + self.copy(cr, uid, ref("project_issue_onchangeevent0"),default, context) +- + Create Message. +- + !python {model: project.issue}: | + msg = { + 'subject': 'test_email', + 'body': 'Testing Project Issue', + 'from': 'Administrator ', + } + self.message_new(cr, uid,msg,context) +- + Update this messages. +- + !python {model: project.issue}: | + vals = {} + msg = { + 'subject': 'test_email', + 'body': 'Testing Project Issue', + 'from': 'Administrator ', + } + context = None + default_act = 'pending' + self.message_update(cr, uid, [ref('project_issue_onchangeevent0')], vals, msg, default_act, context) +- + Send created and update the messages. +- + !python {model: project.issue}: | + self.msg_send(cr, uid, [ref('project_issue_onchangeevent0')]) From ea783079f31a74747f27cfd821d3925603ee8fd9 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Thu, 25 Aug 2011 15:17:17 +0530 Subject: [PATCH 04/36] [IMP]project_issue : Improve the test cases for test_project_issue_states.yml bzr revid: dbr@tinyerp.com-20110825094717-16lqdsgfbc4eyfkb --- addons/project_issue/test/test_project_issue_states.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/project_issue/test/test_project_issue_states.yml b/addons/project_issue/test/test_project_issue_states.yml index ee48c9a9df0..a2112f62155 100644 --- a/addons/project_issue/test/test_project_issue_states.yml +++ b/addons/project_issue/test/test_project_issue_states.yml @@ -43,7 +43,11 @@ - !assert {model: project.issue, id: project_issue_stockmovedates0, severity: error, string: Issue is in pending state}: - state == 'pending' - +- + Keep issue in 'Escalate' state +- + !python {model: project.issue}: | + self.case_escalate(cr, uid, [ref("project_issue_stockmovedates0")], - Open the issue From f5bb3a621cc4ed105190b34673f20d7cfbc22d59 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Thu, 25 Aug 2011 17:27:32 +0530 Subject: [PATCH 05/36] [IMP]project_long_term : Improve the test cases bzr revid: dbr@tinyerp.com-20110825115732-1mowk617x2nfq5s5 --- .../test/phase_constraint.yml | 66 ++++++++++++++++++- .../test/project_schedule_consecutive_day.yml | 14 +++- 2 files changed, 78 insertions(+), 2 deletions(-) diff --git a/addons/project_long_term/test/phase_constraint.yml b/addons/project_long_term/test/phase_constraint.yml index cf6bfa844a6..14ef39ac00f 100644 --- a/addons/project_long_term/test/phase_constraint.yml +++ b/addons/project_long_term/test/phase_constraint.yml @@ -66,6 +66,7 @@ - !python {model: project.project}: | self.write(cr, uid, [ref("project_project_developyamlproject0")], {'resource_calendar_id': ref("resource_calendar_hoursweeks0")}) + self.generate_members(cr, uid, [ref('project_project_developyamlproject0')], context=None) - @@ -141,6 +142,7 @@ from dateutil.relativedelta import * start = datetime.date.today() - relativedelta(days=5) end = datetime.date.today() + relativedelta(days=10) + 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' @@ -176,4 +178,66 @@ for phase in proj.phase_ids: for phase1 in proj.phase_ids: if phase1.id != phase.id and phase.constraint_date_start == phase1.date_start: - raise AssertionError("Phases not scheduled") + raise AssertionError("Phases not scheduled") +- + 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' +- + !python {model: project.phase}: | + self.set_open(cr, uid, [ref("project_phase_developyaml0")]) +- + Now, Compute the Total Hours +- + !python {model: project.phase}: | + field_name = 'test' + arg = {} + self._compute(cr, uid, [ref("project_phase_developyaml0")], field_name, arg, context=None) + +- + Now, change the partner if needed +- + !python {model: project.phase}: | + for project in self.browse(cr, uid, [ref('project_phase_developyaml0')], context): + project_id = project.project_id.id + start_date = project.date_start + end_date = project.date_end + context.update({'start_date' : start_date,'end_date' : end_date}) + self.onchange_project(cr, uid, [ref("project_phase_developyaml0")], project_id,context) +- + Now, Check start date. +- + !python {model: project.phase}: | + try: + self._check_date_start(cr, uid, ref('project_phase_developyaml0'), context.get('end_date'), context) + except: + pass +- + Now, Check end date. +- + !python {model: project.phase}: | + try: + self._check_date_end(cr, uid, ref('project_phase_developyaml0'), context.get('start_date'), context) + except: + pass +- + 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' +- + !python {model: project.phase}: | + self.set_done(cr, uid, [ref("project_phase_developyaml0")]) +- + I am Cancelling the Phase 'Develop Yaml'. +- + !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 10cfc7b6b9c..22604773aeb 100644 --- a/addons/project_long_term/test/project_schedule_consecutive_day.yml +++ b/addons/project_long_term/test/project_schedule_consecutive_day.yml @@ -122,5 +122,17 @@ 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") - + +- + 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) From 343bfb06430407d404d5cde7d3636c9058b4fd42 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Fri, 26 Aug 2011 10:53:16 +0530 Subject: [PATCH 06/36] [IMP]project_mrp : Improve the test cases bzr revid: dbr@tinyerp.com-20110826052316-yo5crmok3eh0130p --- .../project_mrp/test/project_task_procurement.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/addons/project_mrp/test/project_task_procurement.yml b/addons/project_mrp/test/project_task_procurement.yml index faf99dc5419..70efa444fba 100644 --- a/addons/project_mrp/test/project_task_procurement.yml +++ b/addons/project_mrp/test/project_task_procurement.yml @@ -8,7 +8,7 @@ categ_id: product.product_category_7 cost_method: standard mes_type: fixed - name: Partners Training + name: Partners Technical Training procure_method: make_to_order supply_method: produce type: service @@ -30,7 +30,7 @@ order_line: - state: draft delay: 7.0 - name: Partners Training + name: Partners Technical Training price_unit: 1.0 product_id: product_product_partnerstraining0 product_uom: product.uom_day @@ -67,4 +67,13 @@ order = order_obj.browse(cr, uid, ref('sale_order_so0')) task_id = self.search(cr, uid, [('name','like', order.name)]) assert task_id, 'No Task is created!' - +- + Now I am Closing the Created Task Vis Procurment . +- + !python {model: project.task}: | + order_obj = self.pool.get('sale.order') + order = order_obj.browse(cr, uid, ref('sale_order_so0')) + task_id = self.search(cr, uid, [('name','like', order.name)]) + if task_id: + self.do_close(cr, uid, task_id) + self.do_cancel(cr, uid, task_id) From ba715416e9d159bdf21ea4dfc1f26a519c5db92e Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Fri, 26 Aug 2011 15:52:55 +0530 Subject: [PATCH 07/36] [IMP]project_plannig : Improve the test cases bzr revid: dbr@tinyerp.com-20110826102255-h2hclrzvqtmwskaj --- .../project_planning/test/planning_states.yml | 49 ++++++++++++++----- 1 file changed, 38 insertions(+), 11 deletions(-) diff --git a/addons/project_planning/test/planning_states.yml b/addons/project_planning/test/planning_states.yml index 5f7433125de..5c9cf717bd9 100644 --- a/addons/project_planning/test/planning_states.yml +++ b/addons/project_planning/test/planning_states.yml @@ -11,7 +11,7 @@ - - Open the planning + Open the 'Project Planning' - !python {model: report_account_analytic.planning}: | self.action_open(cr, uid, [ref("report_account_analytic_planning_projectplanning0")], @@ -20,13 +20,13 @@ ref("project_planning.menu_report_account_analytic_planning"), "search_default_user_id": 1, "project_id": False, "department_id": False, }) - - Check if planning in open state + Check if 'Project Planning' in open state - !assert {model: report_account_analytic.planning, id: report_account_analytic_planning_projectplanning0, string: Planning in open state}: - state == "open" - - Cancel the planning + Cancel the 'Project Planning' - !python {model: report_account_analytic.planning}: | self.action_cancel(cr, uid, [ref("report_account_analytic_planning_projectplanning0")], @@ -35,13 +35,13 @@ ref("project_planning.menu_report_account_analytic_planning"), "search_default_user_id": 1, "project_id": False, "department_id": False, }) - - Check if planning in cancel state + Check if 'Project Planning' in cancel state - !assert {model: report_account_analytic.planning, id: report_account_analytic_planning_projectplanning0, string: Planning in cancel state}: - state == "cancel" - - Reopen the planning + Reopen the 'Project Planning' - !python {model: report_account_analytic.planning}: | self.action_draft(cr, uid, [ref("report_account_analytic_planning_projectplanning0")], @@ -50,13 +50,13 @@ ref("project_planning.menu_report_account_analytic_planning"), "search_default_user_id": 1, "project_id": False, "department_id": False, }) - - Check if planning in draft state + Check if 'Project Planning' in draft state - !assert {model: report_account_analytic.planning, id: report_account_analytic_planning_projectplanning0, string: Planning in draft state}: - state == "draft" - - Open the planning + Open the 'Project Planning' - !python {model: report_account_analytic.planning}: | self.action_open(cr, uid, [ref("report_account_analytic_planning_projectplanning0")], @@ -65,13 +65,13 @@ ref("project_planning.menu_report_account_analytic_planning"), "search_default_user_id": 1, "project_id": False, "department_id": False, }) - - Check if planning in open state + Check if 'Project Planning' in open state - !assert {model: report_account_analytic.planning, id: report_account_analytic_planning_projectplanning0, string: Planning in open state}: - state == "open" - - Close the planning + Close the 'Project Planning' - !python {model: report_account_analytic.planning}: | self.action_done(cr, uid, [ref("report_account_analytic_planning_projectplanning0")], @@ -79,8 +79,35 @@ "tz": False, "active_model": "ir.ui.menu", "section_id": False, "active_id": ref("project_planning.menu_report_account_analytic_planning"), "search_default_user_id": 1, "project_id": False, "department_id": False, }) + name = 'Project Planning' + self._get_total_planned(cr, uid, [ref("report_account_analytic_planning_projectplanning0")], name, args={},context=None) + self._get_total_free(cr, uid, [ref("report_account_analytic_planning_projectplanning0")], name, args={},context=None) +- + Create analytic planning report +- + !record {model: report_account_analytic.planning.line, id: report_account_analytic_planning_line}: + planning_id : report_account_analytic_planning_projectplanning0 + amount : 100 + amount_unit : product.product_uom_unit +- + Create account analytic report for planning 'Project Planning' +- + !python {model: report_account_analytic.planning.line}: | + self.name_get(cr, uid, [ref("report_account_analytic_planning_line")],context=None) +- + Add project line id in project task report. +- + !record {model: project.task, id: report_account_analytic_planning_line}: + planning_line_id: report_account_analytic_planning_line +- + Now, search palnning for the task +- + !python {model: project.task}: | + context.update({'planning' : ref("report_account_analytic_planning_projectplanning0")}) + self.search(cr, uid, args={}, offset=0, limit=None, order=None, context=context, count=False) + - - Check if planning in done state + Check if 'Project Planning' in done state - !assert {model: report_account_analytic.planning, id: report_account_analytic_planning_projectplanning0, string: Planning in done state}: - - state == "done" + - state == "done" From 74d9fca79447a8f592bc98ff062c12ddfe166237 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Fri, 26 Aug 2011 17:12:05 +0530 Subject: [PATCH 08/36] [IMP]project_retro_plannig : Improve the test cases bzr revid: dbr@tinyerp.com-20110826114205-7hhhg3w4dmfhhiqv --- .../project_retro_planning/test/deadline_change.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/addons/project_retro_planning/test/deadline_change.yml b/addons/project_retro_planning/test/deadline_change.yml index e18a5ad71ee..33f7d44ccaa 100644 --- a/addons/project_retro_planning/test/deadline_change.yml +++ b/addons/project_retro_planning/test/deadline_change.yml @@ -5,7 +5,6 @@ company_id: base.main_company date: !eval time.strftime('%Y-%m-%d') name: Retro Planning - - Create task 'Plan all projects' - @@ -18,3 +17,14 @@ project_id: project_project_retroplanning0 remaining_hours: 24.0 state: draft +- + Execute this project for reteo planning. +- + !python {model: project.project}: | + import time + vals = { + 'company_id': ref('base.main_company'), + 'date': time.strftime("%Y-%m-%d"), + 'name': 'Retro Planning', + } + self.write(cr, uid, [ref('project_project_retroplanning0')], vals) From 8a6ab52dfb75d6841317090beba37c64a38f5879 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Fri, 26 Aug 2011 17:47:57 +0530 Subject: [PATCH 09/36] [ADD]project_scrum : Add file for scrum sprit test cases bzr revid: dbr@tinyerp.com-20110826121757-71ku92r0g5jnzipe --- addons/project_scrum/__openerp__.py | 5 +- .../test/project_scrum_report.yml | 141 +++++++++++++++++- .../project_scrum/test/scrum_sprint_test.yml | 51 +++++++ 3 files changed, 194 insertions(+), 3 deletions(-) create mode 100644 addons/project_scrum/test/scrum_sprint_test.yml diff --git a/addons/project_scrum/__openerp__.py b/addons/project_scrum/__openerp__.py index 9a1713b9014..8cbf199894e 100644 --- a/addons/project_scrum/__openerp__.py +++ b/addons/project_scrum/__openerp__.py @@ -65,7 +65,10 @@ More information on the methodology: "board_project_scrum_view.xml", ], 'demo_xml': ['project_scrum_demo.xml'], - 'test': ['test/project_scrum_report.yml'], + 'test': [ + 'test/project_scrum_report.yml', + 'test/scrum_sprint_test.yml' + ], 'installable': True, 'active': False, 'certificate' : '00736750152003010781', diff --git a/addons/project_scrum/test/project_scrum_report.yml b/addons/project_scrum/test/project_scrum_report.yml index 7fb3e9c07fc..eca3b4033c7 100644 --- a/addons/project_scrum/test/project_scrum_report.yml +++ b/addons/project_scrum/test/project_scrum_report.yml @@ -1,9 +1,146 @@ +- + I assign an email address to Administrator. +- + !record {model: res.users, id: base.user_root}: + user_email: admin@openerp.com +- + Test project template feature +- + Create project 'OpenERP Training Programme' +- + !record {model: project.project, id: project_project_0}: + company_id: base.main_company + name: OpenERP Training Test - In order to test the PDF reports defined on a Project Scrum, we will print Project Scrum Sprint Burndown Report -- +- !python {model: project.scrum.sprint}: | import netsvc, tools, os data_dict = {'model': 'project.scrum.sprint', 'id':ref('project_scrum.scrum_sprint_0')} (data, format) = netsvc.LocalService('report.scrum.sprint.burndown').create(cr, uid, [ref('project_scrum.scrum_sprint_0')], data_dict, {}) if tools.config['test_report_directory']: - file(os.path.join(tools.config['test_report_directory'], 'project_scrum-project_scrum_sprint_burndown.'+format), 'wb+').write(data) \ No newline at end of file + file(os.path.join(tools.config['test_report_directory'], 'project_scrum-project_scrum_sprint_burndown.'+format), 'wb+').write(data) +- + Creating a project.scrum.product.backlog record +- + !record {model: project.scrum.product.backlog, id: project_scrum_product_backlog0}: + effective_hours: 0.0 + expected_hours: 0.0 + name: test + project_id: project_project_0 + sequence: 0.0 + state: draft +- + In order to test the Product Backlog. +- + !python {model: project.scrum.product.backlog}: | + self.button_draft(cr, uid, [ref("project_scrum_product_backlog0")],context=None) +- + Click on Open Button. +- + !python {model: project.scrum.product.backlog}: | + self.button_open(cr, uid, [ref("project_scrum_product_backlog0")],context=None) +- + Click on Pending Button. +- + !python {model: project.scrum.product.backlog}: | + self.button_pending(cr, uid, [ref("project_scrum_product_backlog0")],context=None) +- + Click on Open Button. +- + !python {model: project.scrum.product.backlog}: | + self.button_open(cr, uid, [ref("project_scrum_product_backlog0")],context=None) +- + Creating a project.scrum.meeting record. +- + !record {model: project.scrum.meeting, id: project_scrum_meeting_0}: + date: !eval time.strftime('%Y-%m-%d') + sprint_id: project_scrum.scrum_sprint_0 +- + In order to test the Scrum meeting +- + !python {model: project.scrum.meeting}: | + try: + self.button_send_to_master(cr, uid, [ref("project_scrum_meeting_0")],context=None) + self.button_send_product_owner(cr, uid, [ref("project_scrum_meeting_0")],context=None) + except: + pass +- + Creating a project.scrum.email record. +- + !record {model: project.scrum.email, id: project_scrum_email_0}: + subject: Subject + message: test message +- + Send project scrum email +- + !python {model: project.scrum.email}: | + try: + self.button_send_scrum_email(cr, uid, [ref("project_scrum_email_0")],context=None) + except: + pass +- + Creating first scrum backlog for merge the record. +- + !record {model: project.scrum.backlog.merge, id: project_scrum_backlog_merge1}: + project_id: project_project_0 +- + Creating second scrum backlog for merge the record. +- + !record {model: project.scrum.backlog.merge, id: project_scrum_backlog_merge2}: + project_id: project_project_0 +- + Set project scrum backlog merge. +- + !python {model: project.scrum.backlog.merge}: | + context['active_ids'] = [ref("project_scrum_backlog_merge1"),ref("project_scrum_backlog_merge2")] + context['active_id'] = [ref("project_scrum_backlog_merge1")] + try: + self.check_backlogs(cr, uid, [ref("project_scrum_backlog_merge2")],context) + except: + pass +- + In order to test the project_scrum_backlog_create_task wizard +- + !record {model: project.scrum.backlog.create.task, id: project_scrum_backlog_task0}: + user_id: base.user_root +- + Set project as project template +- + !python {model: project.scrum.backlog.create.task}: | + context['active_ids'] = [ref("project_scrum_backlog_task0")] + self.do_create(cr, uid, [ref("project_scrum_backlog_task0")],context) + +- + Creating a ScrumProduct Backlog Record. +- + !record {model: project.scrum.product.backlog, id: project_scrum_product_demobacklog0}: + effective_hours: 0.0 + expected_hours: 0.0 + name: Demo Product backlog + project_id: project_project_0 + sequence: 0.0 + +- + Creating a postpone.wizard record. +- + !record {model: postpone.wizard, id: postpone_wizard_0}: + {} + +- + Now I am postponding the Backlog "Demo Product backlog". +- + !python {model: postpone.wizard}: | + context['active_ids'] = [ref("project_scrum_product_demobacklog0")] + context['active_id'] = [ref("postpone_wizard_0")] + self.button_postpone( cr, uid, [ref("postpone_wizard_0")], context=context) +- + Click on Postpone Button. +- + !python {model: project.scrum.product.backlog}: | + self.button_postpone(cr, uid, [ref("project_scrum_product_backlog0")],context=None) +- + Click on Close Button. +- + !python {model: project.scrum.product.backlog}: | + self.button_close(cr, uid, [ref("project_scrum_product_backlog0")],context=None) diff --git a/addons/project_scrum/test/scrum_sprint_test.yml b/addons/project_scrum/test/scrum_sprint_test.yml new file mode 100644 index 00000000000..083c2faca18 --- /dev/null +++ b/addons/project_scrum/test/scrum_sprint_test.yml @@ -0,0 +1,51 @@ +- + Creating a Scrum Sprint Record +- + !record {model: project.scrum.sprint, id: project_scrum_sprint_testsprint0}: + date_start: !eval time.strftime('%Y-%m-01') + date_stop: !eval time.strftime('%Y-%m-17') + name: Demo Sprint + product_owner_id: base.user_admin + project_id: project.project_project_22 + scrum_master_id: base.user_admin + state: draft +- + I am copying the "Demo Sprint" Sprint +- + !python {model: project.scrum.sprint}: | + self.copy(cr, uid, ref("project_scrum_sprint_testsprint0")) +- + I am changing the Project of the "Demo Sprint" Sprint +- + !python {model: project.scrum.sprint}: | + self.onchange_project_id(cr, uid, [ref("project_scrum_sprint_testsprint0")], ref("project.project_project_9")) + +- + I am Opeing the "Demo Sprint" Sprint +- + !python {model: project.scrum.sprint}: | + self.button_open(cr, uid, [ref("project_scrum_sprint_testsprint0")]) + +- + I am Setting the "Demo Sprint" Sprint to Pending +- + !python {model: project.scrum.sprint}: | + self.button_pending(cr, uid, [ref("project_scrum_sprint_testsprint0")]) + +- + I am Closing the "Demo Sprint" Sprint. +- + !python {model: project.scrum.sprint}: | + self.button_close(cr, uid, [ref("project_scrum_sprint_testsprint0")]) + +- + I am Setting the "Demo Sprint" Sprint to Draft. +- + !python {model: project.scrum.sprint}: | + self.button_draft(cr, uid, [ref("project_scrum_sprint_testsprint0")]) + +- + I am Cancelling the "Demo Sprint" Sprint. +- + !python {model: project.scrum.sprint}: | + self.button_cancel(cr, uid, [ref("project_scrum_sprint_testsprint0")]) From 5906bf6b5aa0b1d4540b5e86e7a037c16a3144aa Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Fri, 26 Aug 2011 18:01:00 +0530 Subject: [PATCH 10/36] [IMP]project_scrum : Improve the test cases bzr revid: dbr@tinyerp.com-20110826123100-kwv3k2kg3z8xwrl1 --- .../test/project_scrum_report.yml | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/addons/project_scrum/test/project_scrum_report.yml b/addons/project_scrum/test/project_scrum_report.yml index eca3b4033c7..e48d3f73c3f 100644 --- a/addons/project_scrum/test/project_scrum_report.yml +++ b/addons/project_scrum/test/project_scrum_report.yml @@ -34,6 +34,7 @@ In order to test the Product Backlog. - !python {model: project.scrum.product.backlog}: | + self.name_search(cr, uid, name='test', args=None, operator='ilike', context=None, limit=100) self.button_draft(cr, uid, [ref("project_scrum_product_backlog0")],context=None) - Click on Open Button. @@ -126,7 +127,6 @@ - !record {model: postpone.wizard, id: postpone_wizard_0}: {} - - Now I am postponding the Backlog "Demo Product backlog". - @@ -144,3 +144,22 @@ - !python {model: project.scrum.product.backlog}: | self.button_close(cr, uid, [ref("project_scrum_product_backlog0")],context=None) +- + Click on Cancel Button. +- + !python {model: project.scrum.product.backlog}: | + self.button_cancel(cr, uid, [ref("project_scrum_product_backlog0")],context=None) +- + Create a backlog sprint +- + !record {model: project.scrum.backlog.assign.sprint, id: project_scrum_backlog_assign_sprint}: + {} +- + Now, I am assigning it. +- + !python {model: project.scrum.backlog.assign.sprint}: | + context.update({'active_ids': [ref('project_scrum_backlog_task0')], 'avtive_id': ref('project_scrum_backlog_task0')}) + try: + self.assign_sprint(cr, uid, [ref("project_scrum_backlog_assign_sprint")], context=context) + except: + pass From 71b2a9d0c9fb6231971d8ae8d986ca7a41132e39 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Fri, 26 Aug 2011 18:48:39 +0530 Subject: [PATCH 11/36] [IMP]project_timesheet : Improve the test cases bzr revid: dbr@tinyerp.com-20110826131839-tadw5ajn0guq470q --- .../worktask_entry_to_timesheetline_entry.yml | 41 ++++++++++++++++++- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/addons/project_timesheet/test/worktask_entry_to_timesheetline_entry.yml b/addons/project_timesheet/test/worktask_entry_to_timesheetline_entry.yml index 4cf790c4e2b..4060c3016fe 100644 --- a/addons/project_timesheet/test/worktask_entry_to_timesheetline_entry.yml +++ b/addons/project_timesheet/test/worktask_entry_to_timesheetline_entry.yml @@ -64,7 +64,12 @@ !record {model: project.project, id: project_project_timesheetmanagement0}: company_id: base.main_company name: Timesheet Management - + +- + Change the partner to the realted project +- + !python {model: project.project}: | + self.onchange_partner_id(cr, uid, [ref('project_project_timesheetmanagement0')], part=False, context=None) - Create a task 'Get all timesheet records' @@ -86,6 +91,7 @@ "en_US", "active_ids": [ref("project_project_timesheetmanagement0")], "tz": False, "active_model": "project.project", "department_id": False, "project_id": False, "active_id": ref("project_project_timesheetmanagement0"), }) + self.write(cr, uid, [ref('project_task_getalltimesheetrecords0')], {'name': 'Get all timesheet records','project_id': ref('project_project_timesheetmanagement0'),'user_id': ref('res_users_hrmanager0')},context) - Make a work task entry 'Get work calendar of all employees' of 10 hours done by HR manager @@ -96,9 +102,40 @@ hours: 10.0 name: Get work calendar of all employees user_id: res_users_hrmanager0 - +- + Creating a project.task.work record +- + !record {model: project.task.work, id: project_task_work_test0}: + company_id: base.main_company + date: !eval time.strftime('%Y-06-%d') + hours: 10.0 + name: test + task_id: project_task_getalltimesheetrecords0 + user_id: res_users_hrmanager0 +- + Add the work details +- + !python {model: project.task.work}: | + import time + vals = { + 'company_id': ref('base.main_company'), + 'date': time.strftime('%Y-06-%d'), + 'hours': 10.0, + 'name': 'test', + 'task_id': ref('project_task_getalltimesheetrecords0'), + 'user_id': ref('res_users_hrmanager0'), + } + + self.get_user_related_details(cr, uid, ref('res_users_hrmanager0')) + self.write(cr, uid, [ref('project_task_work_test0')], vals,context) + self.unlink(cr, uid, [ref('project_task_work_test0')]) - Check for timesheet_ids in HR manager's timesheet - !assert {model: hr_timesheet_sheet.sheet, id: hr_timesheet_sheet_sheet_sheetforhrmanager0, string: After hr manager's work task, length of timesheet line of current timesheet must be greater then 1}: - len(timesheet_ids) > 0 +- + Unlink the task +- + !python {model: project.task}: | + self.unlink(cr, uid, [ref("project_task_getalltimesheetrecords0")]) From 81a93234ee9abec8d9993bd3e39d9aa0f7ca2f47 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Mon, 29 Aug 2011 11:47:05 +0530 Subject: [PATCH 12/36] [IMP]project : Improve the code for state of project.task obj bzr revid: dbr@tinyerp.com-20110829061705-ri0cbexs4pp6yjjo --- addons/project/test/test_project.yml | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/addons/project/test/test_project.yml b/addons/project/test/test_project.yml index 43ad07abe05..ab51bdaf251 100644 --- a/addons/project/test/test_project.yml +++ b/addons/project/test/test_project.yml @@ -38,6 +38,26 @@ !python {model: project.task}: | self._default_project(cr, uid,context) self.fields_view_get(cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False) +- + Click on Draft button. +- + !python {model: project.task}: | + self.do_draft(cr, uid, [ref("project_task_functionaltraining0")], context={}) +- + Click on Start task button. +- + !python {model: project.task}: | + self.do_open(cr, uid,[ref("project_task_functionaltraining0")],context={}) +- + Click Pending button +- + !python {model: project.task}: | + self.do_pending(cr, uid, [ref("project_task_functionaltraining0")], context={}) +- + Click on Start task button. +- + !python {model: project.task}: | + self.do_open(cr, uid,[ref("project_task_functionaltraining0")],context={}) - Check child project. - @@ -54,12 +74,12 @@ !python {model: project.task}: | self._change_type(cr, uid,[ref("project_task_functionaltraining0")], next, context) - - Click on next Button. + Click on next Button for change the type of project task. - !python {model: project.task}: | self.next_type(cr, uid,[ref("project_task_functionaltraining0")], context) - - Click on previous Button. + Click on previous Button for go back to previous type of task. - !python {model: project.task}: | self.prev_type(cr, uid,[ref("project_task_functionaltraining0")], context) @@ -364,6 +384,7 @@ self.set_done(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"), }) + - Check if project in close state - @@ -402,7 +423,7 @@ self.default_get(cr, uid, fields, context={"active_ids":[ref("project_task_technicaltraining0")],"active_id": ref("project_task_technicaltraining0")}) self.send(cr, uid, [ref('project_task_close_0')], context={"active_ids":[ref("project_task_technicaltraining0")],"active_id": ref("project_task_technicaltraining0")}) - - Close this project. + Click on the project task's Done button. - !python {model: project.task}: | self.action_close(cr, uid, [ref("project_task_functionaltraining0")],context={"lang": "en_US", "active_ids": [ref("project_project_openerptrainingprogramme0")],"tz": False, "active_id": ref("project_project_openerptrainingprogramme0")}) From 3d946d9da2618f227180c3175bfb0977673f30ed Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Mon, 29 Aug 2011 12:04:54 +0530 Subject: [PATCH 13/36] [IMP]project_gtd : Improve the test cases bzr revid: dbr@tinyerp.com-20110829063454-hcfc0311n94cye9k --- addons/project_gtd/test/gtd_test.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/project_gtd/test/gtd_test.yml b/addons/project_gtd/test/gtd_test.yml index 1d5e1032616..5c9b29af2f4 100644 --- a/addons/project_gtd/test/gtd_test.yml +++ b/addons/project_gtd/test/gtd_test.yml @@ -49,11 +49,14 @@ Set the task to tomorrow timebox - !python {model: project.timebox.fill.plan}: | - self.process(cr, uid, [ref("project_timebox_fill_plan_0")], {"lang": "en_US", + context={"lang": "en_US", "project_id": False, "tz": False, "active_model": "project.gtd.timebox", "department_id": False, "section_id": False, "record_id": 1, "active_ids": [ref("project_gtd.timebox_daily")], "active_id": ref("project_gtd.timebox_daily"), - }) + } + self.process(cr, uid, [ref("project_timebox_fill_plan_0")], context=context) + self._get_from_tb(cr, uid, context=context) + self._get_to_tb(cr, uid, context=context) - Copy the task 'Develop time management module'. - From 2fa5340eb5aa251528a1e7c0c848014b2c9a4e31 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Mon, 29 Aug 2011 13:01:16 +0530 Subject: [PATCH 14/36] [IMP]project_issue : Improve the test cases bzr revid: dbr@tinyerp.com-20110829073116-6jdfnow888mfan6o --- .../test/test_project_issue_states.yml | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/addons/project_issue/test/test_project_issue_states.yml b/addons/project_issue/test/test_project_issue_states.yml index a2112f62155..a86aef292aa 100644 --- a/addons/project_issue/test/test_project_issue_states.yml +++ b/addons/project_issue/test/test_project_issue_states.yml @@ -1,5 +1,10 @@ - - Create an issue + I assign an Escalation project as "Study + Prototype". +- + !record {model: project.project, id: project.project_project_22}: + project_escalation_id: project.project_project_21 +- + Create an issue for "Specific Developments" project - !record {model: project.issue, id: project_issue_stockmovedates0}: categ_id: project_issue.bug_categ @@ -12,7 +17,6 @@ - !assert {model: project.issue, id: project_issue_stockmovedates0, severity: error, string: Issue is in draft state}: - state == 'draft' - - Open the issue - @@ -27,7 +31,6 @@ - !assert {model: project.issue, id: project_issue_stockmovedates0, severity: error, string: Issue is in open state}: - state == 'open' - - Keep issue pending - @@ -38,17 +41,20 @@ 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 'pending' state -- - !assert {model: project.issue, id: project_issue_stockmovedates0, severity: error, string: Issue is in pending state}: - - state == 'pending' - Keep issue in 'Escalate' state - !python {model: project.issue}: | - self.case_escalate(cr, uid, [ref("project_issue_stockmovedates0")], - + 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 +- + !assert {model: project.issue, id: project_issue_stockmovedates0, severity: error, string: Issue is in pending state}: + - state == 'pending' - Open the issue - @@ -63,8 +69,6 @@ - !assert {model: project.issue, id: project_issue_stockmovedates0, severity: error, string: Issue is in open state}: - state == 'open' - - - Cancel the issue - @@ -80,8 +84,6 @@ - !assert {model: project.issue, id: project_issue_stockmovedates0, severity: error, string: Issue is in cancel state}: - state == 'cancel' - - - Reset the issue - @@ -97,8 +99,6 @@ - !assert {model: project.issue, id: project_issue_stockmovedates0, severity: error, string: Issue is in draft state}: - state == 'draft' - - - Close the issue - From 3b42faa61fc62c8144bd0cb7137518548bade08b Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Wed, 31 Aug 2011 11:16:08 +0530 Subject: [PATCH 15/36] [IMP]project: Improve the test cases bzr revid: dbr@tinyerp.com-20110831054608-ddf25m58c4gvmq87 --- addons/project/test/test_project.yml | 85 ++++++++++++++++--- .../project/test/test_project_delegation.yml | 6 +- 2 files changed, 74 insertions(+), 17 deletions(-) diff --git a/addons/project/test/test_project.yml b/addons/project/test/test_project.yml index ab51bdaf251..df6f04e777f 100644 --- a/addons/project/test/test_project.yml +++ b/addons/project/test/test_project.yml @@ -3,6 +3,12 @@ - !record {model: res.users, id: base.user_root}: user_email: admin@openerp.com +- + Create analytic account. +- + !record {model: account.analytic.account, id: account_analytic_account0}: + name : account_analytic_account + partner_id: base.res_partner_asus - Now, Test project template feature - @@ -10,7 +16,10 @@ - !record {model: project.project, id: project_project_openerptrainingprogramme0}: company_id: base.main_company + partner_id: base.res_partner_asus name: OpenERP Training Programme + date_start: !eval time.strftime('%Y-%m-%d') + date: !eval time.strftime('%Y-%m-%d') - Create task 'Technical Training' for this project - @@ -22,6 +31,16 @@ project_id: project_project_openerptrainingprogramme0 remaining_hours: 30.0 state: draft +- + 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') + name: Training + planned_hours: 30.0 + project_id: project_project_openerptrainingprogramme0 + remaining_hours: 30.0 + state: done - Create task 'Functional Training' for this project - @@ -31,11 +50,14 @@ planned_hours: 30.0 project_id: project_project_openerptrainingprogramme0 remaining_hours: 30.0 + child_ids: + - project_task_child0 state: draft - Set project's task view - !python {model: project.task}: | + context.update({'project_id': ref('project_task_functionaltraining0')}) self._default_project(cr, uid,context) self.fields_view_get(cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False) - @@ -103,7 +125,7 @@ Change the project's partner if needed. - !python {model: project.project}: | - self.onchange_partner_id(cr, uid, [ref("project_project_openerptrainingprogramme0")], part=False, 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")}) + 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")}) - Set project as project template - @@ -264,11 +286,7 @@ !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 -- - Create analytic account. -- - !record {model: account.analytic.account, id: account_analytic_account0}: - name : account_analytic_account + - Set remaining hours of 10 hours for reevaluating the task - @@ -377,13 +395,36 @@ - planned_hours == 30 - remaining_hours == 0.0 - effective_hours == 45.0 +- + Execute the search method +- + !python {model: project.project}: | + context.update({"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")}) + user = ref('base.user_demo') + try: + self.search(cr, user, args={}, offset=0, limit=None, order=None, context=None, count=False) + except: + pass - Close project 'OpenERP Training Programme' - !python {model: project.project}: | - self.set_done(cr, uid, [ref("project_project_openerptrainingprogramme0")], {"lang": "en_US", "active_ids": [ref("project.menu_open_view_project_all")], + context.update({"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"), }) + ref("project.menu_open_view_project_all")}) + user = ref('base.user_demo') + args={} + offset=0 + limit=None + order=None + count=False + try: + self.search(cr, user, args, offset, limit, order, context, count) + except: + pass + self.set_done(cr, uid, [ref("project_project_openerptrainingprogramme0")], context=context) - Check if project in close state @@ -421,20 +462,38 @@ 'description' : 'Description' } self.default_get(cr, uid, fields, context={"active_ids":[ref("project_task_technicaltraining0")],"active_id": ref("project_task_technicaltraining0")}) - self.send(cr, uid, [ref('project_task_close_0')], context={"active_ids":[ref("project_task_technicaltraining0")],"active_id": ref("project_task_technicaltraining0")}) + try: + self.send(cr, uid, [ref('project_task_close_0')], context={"active_ids":[ref("project_task_technicaltraining0")],"active_id": ref("project_task_technicaltraining0")}) + except : + pass - - Click on the project task's Done button. + Check for remaining hours - !python {model: project.task}: | - self.action_close(cr, uid, [ref("project_task_functionaltraining0")],context={"lang": "en_US", "active_ids": [ref("project_project_openerptrainingprogramme0")],"tz": False, "active_id": ref("project_project_openerptrainingprogramme0")}) + self.onchange_remaining(cr, uid, [ref("project_task_functionaltraining0")], remaining = 0.0, planned = 0.0) +- + Change the planned. +- + !python {model: project.task}: | + self.onchange_planned(cr, uid, [ref("project_task_functionaltraining0")], planned = 0.0, effective = 0.0) - Cancel this project. - !python {model: project.task}: | self.do_cancel(cr, uid,[ref("project_task_functionaltraining0")],context={}) - - Unlink this project. + Unlink this project's task. - !python {model: project.task}: | self.unlink(cr, uid,[ref("project_task_functionaltraining0")]) - +- + Create test project 'OpenERP Test Programme' +- + !record {model: project.project, id: project_project_testprogramme0}: + company_id: base.main_company + name: OpenERP Training Programm +- + Unlink the project. +- + !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 730c019b701..df039965523 100644 --- a/addons/project/test/test_project_delegation.yml +++ b/addons/project/test/test_project_delegation.yml @@ -15,7 +15,7 @@ planned_hours: 20.0 project_id: project_project_openerpdocumentation0 remaining_hours: 20.0 - state: draft + state: pending - Open the 'Develop book for Technical and Functional reference' task - @@ -23,7 +23,6 @@ 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 task 'Publish the References' - @@ -75,7 +74,7 @@ Validating the delegate task. - !python {model: project.task.delegate}: | - self.delegate(cr, uid, [ref("project_task_publish_book_delegate")],context={"lang": "en_US", "active_model": "project.task", "tz": False,"record_id":4, "active_ids": [ref("project_task_publish_book")], "active_id": ref("project_task_publish_book")}) + self.delegate(cr, uid, [ref('project_task_publish_book_delegate')], {"active_id": ref("project_task_publish_book")}) - Check if parent task 'CHECK Publish the References' is in pending state - @@ -173,7 +172,6 @@ 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 - From 09271cb1b172c32ac87e3b5df87d00a5b0ad23cd Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Wed, 31 Aug 2011 12:21:17 +0530 Subject: [PATCH 16/36] [IMP]project: Improve the test cases for create and copy methods bzr revid: dbr@tinyerp.com-20110831065117-rpabqqr5iwr82x9d --- addons/project/test/test_project.yml | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/addons/project/test/test_project.yml b/addons/project/test/test_project.yml index df6f04e777f..e107456e8c5 100644 --- a/addons/project/test/test_project.yml +++ b/addons/project/test/test_project.yml @@ -11,6 +11,12 @@ partner_id: base.res_partner_asus - Now, Test project template feature +- + Create test project 'OpenERP Test Programme' +- + !record {model: project.project, id: project_project_testprogramme0}: + company_id: base.main_company + name: OpenERP Training Programm - Create project 'OpenERP Training Programme' - @@ -111,6 +117,15 @@ !record {model: project.task.work, id: project_task_work0}: name: Technical Training Task's Work task_id: project_task_technicaltraining0 +- + Create project's Work +- + !python {model: project.task.work}: | + vals = { + 'name': 'Technical Training', + 'task_id': ref('project_task_technicaltraining0'), + } + self.create(cr, uid, vals,context={"lang": "en_US", "active_ids": [ref("project_task_functionaltraining0")],"tz": False, "active_id": ref("project_task_functionaltraining0")}) - Add project's Work - @@ -407,6 +422,11 @@ self.search(cr, user, args={}, offset=0, limit=None, order=None, context=None, count=False) except: pass +- + Copy project 'OpenERP Training Programme' +- + !python {model: project.project}: | + self.copy(cr, uid, ref("project_project_testprogramme0"), default={}, context=None) - Close project 'OpenERP Training Programme' - @@ -486,12 +506,6 @@ - !python {model: project.task}: | self.unlink(cr, uid,[ref("project_task_functionaltraining0")]) -- - Create test project 'OpenERP Test Programme' -- - !record {model: project.project, id: project_project_testprogramme0}: - company_id: base.main_company - name: OpenERP Training Programm - Unlink the project. - From 5cecf136d95f0d4d6f1b8d8c91e130e3524b8903 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Wed, 31 Aug 2011 12:47:20 +0530 Subject: [PATCH 17/36] [IMP]project_gtd: Improve the test cases bzr revid: dbr@tinyerp.com-20110831071720-5tlklk61p1os7ikj --- addons/project_gtd/test/gtd_test.yml | 74 +++++++++++++--------------- 1 file changed, 33 insertions(+), 41 deletions(-) diff --git a/addons/project_gtd/test/gtd_test.yml b/addons/project_gtd/test/gtd_test.yml index 5c9b29af2f4..a4ff2529a1e 100644 --- a/addons/project_gtd/test/gtd_test.yml +++ b/addons/project_gtd/test/gtd_test.yml @@ -1,8 +1,6 @@ -- - Create concepts defined by the Getting Things Done methodology. -- +- Create a task 'Develop time management module' with monthly timebox -- +- !record {model: project.task, id: project_task_developtimemanagementmodule0}: name: Develop time management module planned_hours: 15.0 @@ -10,14 +8,24 @@ remaining_hours: 15.0 state: draft timebox_id: project_gtd.timebox_monthly -- - Create view for 'Develop time management module'. -- +- + Copy the task +- !python {model: project.task}: | - self.fields_view_get(cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False) -- - Open the 'Develop time management module' task -- + self.copy_data(cr, uid, ref("project_task_developtimemanagementmodule0"), default=None, context=None) +- + Change the time to next +- + !python {model: project.task}: | + self.next_timebox(cr, uid, [ref("project_task_developtimemanagementmodule0")]) +- + Change the time to previous +- + !python {model: project.task}: | + self.prev_timebox(cr, uid, [ref("project_task_developtimemanagementmodule0")]) +- + Open the task +- !python {model: project.task}: | self.do_open(cr, uid, [ref("project_task_developtimemanagementmodule0")], {"lang": "en_US", "project_id": False, "tz": False, "active_model": "ir.ui.menu", @@ -25,62 +33,47 @@ False, "search_default_user_id": 1, "search_default_current": 1, "active_ids": [ref("project.menu_action_view_task")], "active_id": ref("project.menu_action_view_task"), }) -- +- 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 -- +- !record {model: project.gtd.timebox, id: project_gtd_timebox_tomorrow1}: name: Tomorrow sequence: 0.0 -- +- Planify the task from monthly timebox to tomorrow timebox -- +- !record {model: project.timebox.fill.plan, id: project_timebox_fill_plan_0}: task_ids: - project_task_developtimemanagementmodule0 timebox_id: project_gtd.timebox_monthly timebox_to_id: project_gtd_timebox_tomorrow1 -- +- Set the task to tomorrow timebox -- +- !python {model: project.timebox.fill.plan}: | - context={"lang": "en_US", + self._get_from_tb(cr, uid, context=None) + self._get_to_tb(cr, uid, context=None) + self.process(cr, uid, [ref("project_timebox_fill_plan_0")], {"lang": "en_US", "project_id": False, "tz": False, "active_model": "project.gtd.timebox", "department_id": False, "section_id": False, "record_id": 1, "active_ids": [ref("project_gtd.timebox_daily")], "active_id": ref("project_gtd.timebox_daily"), - } - self.process(cr, uid, [ref("project_timebox_fill_plan_0")], context=context) - self._get_from_tb(cr, uid, context=context) - self._get_to_tb(cr, uid, context=context) -- - Copy the task 'Develop time management module'. -- - !python {model: project.task}: | - self.copy_data(cr, uid, ref('project_task_developtimemanagementmodule0'), default=None, context=None) + }) - 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") -- - Click on Next button. -- - !python {model: project.task}: | - self.next_timebox(cr, uid, [ref('project_task_developtimemanagementmodule0')]) -- - Click on Previous button. -- - !python {model: project.task}: | - self.prev_timebox(cr, uid, [ref('project_task_developtimemanagementmodule0')]) - Empty Timebox for tomorrow - !python {model: project.timebox.empty}: | + self.view_init(cr , uid , fields_list={}, context=None) self._empty(cr, uid, {"lang": "en_US", "project_id": False, "tz": False, "active_model": "project.gtd.timebox", "department_id": False, "section_id": False, "record_id": 1, "active_ids": @@ -89,6 +82,5 @@ - 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}: + !assert {model: project.task, id: project_task_developtimemanagementmodule0, string: Task is not in tomorrow timebox}: - timebox_id.id != ref("project_gtd_timebox_tomorrow1") - From 8b125dd8dcbb5ec85365862dfcf547d2d8479057 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Wed, 31 Aug 2011 15:01:39 +0530 Subject: [PATCH 18/36] [IMP]project_issue: Improve test cases bzr revid: dbr@tinyerp.com-20110831093139-kisy7psaz0zl0rt8 --- .../test/convert_issue_to_task.yml | 24 +++++++++++++++++-- .../test/test_project_issue_states.yml | 6 +++++ 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/addons/project_issue/test/convert_issue_to_task.yml b/addons/project_issue/test/convert_issue_to_task.yml index bba5d335458..e3297f5be1b 100644 --- a/addons/project_issue/test/convert_issue_to_task.yml +++ b/addons/project_issue/test/convert_issue_to_task.yml @@ -20,17 +20,36 @@ task_id: project_task_training0 working_hours_close: 0.0 working_hours_open: 0.0 - - 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. +- + !python {model: project.issue}: | + import time + args = {} + fields = { + 'categ_id': ref('project_issue.bug_categ'), + 'date_open': time.strftime('%Y-%m-%d'), + 'name': 'on_change event does not pass context to the method', + 'project_id': ref('project.project_project_22'), + 'task_id': ref('project_task_training0'), + 'working_hours_close': 0.0, + 'working_hours_open': 0.0, + 'days_since_creation':'' + } + self._compute_day(cr, uid, [ref('project_issue_onchangeevent0')], fields, args, context=None) - Convert project issue to task - !python {model: project.issue}: | + try: + self._get_issue_work(cr, uid, [ref('project_issue_onchangeevent0')], context=None) + except: + pass self.convert_issue_task(cr, uid, [ref("project_issue_onchangeevent0")], {"lang": "en_US", "project_id": False, "tz": False, "active_model": "ir.ui.menu", "department_id": False, "section_id": False, "search_default_project_id": @@ -47,6 +66,7 @@ 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 diff --git a/addons/project_issue/test/test_project_issue_states.yml b/addons/project_issue/test/test_project_issue_states.yml index a86aef292aa..f1767c6af99 100644 --- a/addons/project_issue/test/test_project_issue_states.yml +++ b/addons/project_issue/test/test_project_issue_states.yml @@ -3,12 +3,18 @@ - !record {model: project.project, id: project.project_project_22}: project_escalation_id: project.project_project_21 +- + Check escalate the project assign +- + !python {model: project.project}: | + self._check_escalation(cr, uid, [ref('project.project_project_22')], context=None) - Create an issue for "Specific Developments" project - !record {model: project.issue, id: project_issue_stockmovedates0}: categ_id: project_issue.bug_categ name: Stock Move dates + task_id: project_task_training0 project_id: project.project_project_22 working_hours_close: 0.0 working_hours_open: 0.0 From d6bea19b1480511ecfc6173b65a8f09f25bdc6e8 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Wed, 31 Aug 2011 17:07:38 +0530 Subject: [PATCH 19/36] [IMP]project_long_term: Improve test cases bzr revid: dbr@tinyerp.com-20110831113738-ybtzopz19r90ow8j --- .../test/phase_constraint.yml | 19 ++++++++++++++----- .../test/schedule_project_phases.yml | 10 +++++++++- .../test/test_schedule_phases_case1.yml | 1 + 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/addons/project_long_term/test/phase_constraint.yml b/addons/project_long_term/test/phase_constraint.yml index 14ef39ac00f..b01d9c066bc 100644 --- a/addons/project_long_term/test/phase_constraint.yml +++ b/addons/project_long_term/test/phase_constraint.yml @@ -65,10 +65,16 @@ Now Set working period to Project 'Develop yaml Project Module' - !python {model: project.project}: | - self.write(cr, uid, [ref("project_project_developyamlproject0")], {'resource_calendar_id': ref("resource_calendar_hoursweeks0")}) - self.generate_members(cr, uid, [ref('project_project_developyamlproject0')], context=None) - + context.update({'resource_calendar_id': ref("resource_calendar_hoursweeks0")}) + self.write(cr, uid, [ref("project_project_developyamlproject0")], context) + self.schedule_tasks(cr, uid, [ref('project_project_developyamlproject0')], context) + for project in self.browse(cr, uid, [ref('project_project_developyamlproject0')], context): + start_date = project.date_start + end_date = start_date + context.update({'start_date' : start_date,'end_date' : end_date}) + 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. For that Creating a Analyst Human resource to analyst Project Yaml. @@ -131,6 +137,7 @@ name: Develop Yaml product_uom: product.uom_day project_id: project_project_developyamlproject0 + responsible_id: base.user_admin previous_phase_ids: - project_phase_analysisflowforyaml0 @@ -212,16 +219,18 @@ Now, Check start date. - !python {model: project.phase}: | + phase=self.browse(cr, uid, ref('project_phase_developyaml0'), context=context) try: - self._check_date_start(cr, uid, ref('project_phase_developyaml0'), context.get('end_date'), context) + self._check_date_start(cr, uid, phase, context.get('end_date'), context) except: pass - Now, Check end date. - !python {model: project.phase}: | + phase=self.browse(cr, uid, ref('project_phase_developyaml0'), context=context) try: - self._check_date_end(cr, uid, ref('project_phase_developyaml0'), context.get('start_date'), context) + self._check_date_end(cr, uid, phase, context.get('start_date'), context) except: pass - diff --git a/addons/project_long_term/test/schedule_project_phases.yml b/addons/project_long_term/test/schedule_project_phases.yml index 4bc6549bf35..8da1d4d124b 100644 --- a/addons/project_long_term/test/schedule_project_phases.yml +++ b/addons/project_long_term/test/schedule_project_phases.yml @@ -38,7 +38,15 @@ !record {model: project.resource.allocation, id: res_phase1}: resource_id: project_long_term.resource_project_manager phase_id: project_phase_definingclientsbasicideaofproject0 - +- + call get_name function +- + !python {model: project.resource.allocation}: | + arg={} + field_name = { + 'phase_id': ref('project_phase_definingclientsbasicideaofproject0') + } + self.get_name(cr, uid, [ref('res_phase1')], field_name, arg, context=None) - Resource2 - 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 ba091a29916..d02082d989a 100644 --- a/addons/project_long_term/test/test_schedule_phases_case1.yml +++ b/addons/project_long_term/test/test_schedule_phases_case1.yml @@ -62,6 +62,7 @@ !python {model: project.phase}: | import datetime from dateutil.relativedelta import * + self.copy(cr, uid, ref('project_phase_firstphase0_case1'), default={}, context=None) start = (datetime.date.today()).strftime('%Y-%m-%d') end = (datetime.date.today() + relativedelta(days=2)).strftime('%Y-%m-%d') first_phase = self.browse(cr, uid, ref('project_phase_firstphase0_case1')) From da10b71e5010c12739afdeeff14abe05dccd87fc Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Wed, 31 Aug 2011 18:56:00 +0530 Subject: [PATCH 20/36] [IMP]project_scrum: Improve test cases bzr revid: dbr@tinyerp.com-20110831132600-fz0dd6ujd19sabz6 --- addons/project_scrum/test/project_scrum_report.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/addons/project_scrum/test/project_scrum_report.yml b/addons/project_scrum/test/project_scrum_report.yml index e48d3f73c3f..d7c5b43454a 100644 --- a/addons/project_scrum/test/project_scrum_report.yml +++ b/addons/project_scrum/test/project_scrum_report.yml @@ -76,8 +76,14 @@ Send project scrum email - !python {model: project.scrum.email}: | + fields={ + 'subject': 'Subject', + 'message': 'test message' + } + context.update({'active_ids':[ref('project_scrum_meeting_0')],'active_id':ref('project_scrum_meeting_0')}) + self.default_get(cr, uid, fields, context) try: - self.button_send_scrum_email(cr, uid, [ref("project_scrum_email_0")],context=None) + self.button_send_scrum_email(cr, uid, [ref("project_scrum_email_0")],context) except: pass - From 255846812bc3f9b21357e94b8a76b8e1a2aabd4c Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Tue, 6 Sep 2011 18:24:34 +0530 Subject: [PATCH 21/36] [IMP]project: Improve the test cases bzr revid: dbr@tinyerp.com-20110906125434-x2ure1gykpuo9tcf --- addons/project/test/test_project.yml | 36 +++++++++++++++++++++------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/addons/project/test/test_project.yml b/addons/project/test/test_project.yml index e107456e8c5..0ac1bc2ea85 100644 --- a/addons/project/test/test_project.yml +++ b/addons/project/test/test_project.yml @@ -3,12 +3,6 @@ - !record {model: res.users, id: base.user_root}: user_email: admin@openerp.com -- - Create analytic account. -- - !record {model: account.analytic.account, id: account_analytic_account0}: - name : account_analytic_account - partner_id: base.res_partner_asus - Now, Test project template feature - @@ -17,11 +11,18 @@ !record {model: project.project, id: project_project_testprogramme0}: company_id: base.main_company name: OpenERP Training Programm +- + Create analytic account. +- + !record {model: account.analytic.account, id: account_analytic_account0}: + name : account_analytic_account + partner_id: base.res_partner_asus - Create project 'OpenERP Training Programme' - !record {model: project.project, id: project_project_openerptrainingprogramme0}: company_id: base.main_company + parent_id: account_analytic_account0 partner_id: base.res_partner_asus name: OpenERP Training Programme date_start: !eval time.strftime('%Y-%m-%d') @@ -66,6 +67,7 @@ context.update({'project_id': ref('project_task_functionaltraining0')}) self._default_project(cr, uid,context) self.fields_view_get(cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False) + self.action_close - Click on Draft button. - @@ -91,6 +93,11 @@ - !python {model: project.task}: | self._check_child_task(cr, uid, [ref("project_task_functionaltraining0")]) +- + Do some changes on project without define partner. +- + !python {model: project.task}: | + self.onchange_project(cr, uid, [ref("project_task_functionaltraining0")],[]) - Do some changes on project. - @@ -123,6 +130,7 @@ !python {model: project.task.work}: | vals = { 'name': 'Technical Training', + 'hours': 0.0, 'task_id': ref('project_task_technicaltraining0'), } self.create(cr, uid, vals,context={"lang": "en_US", "active_ids": [ref("project_task_functionaltraining0")],"tz": False, "active_id": ref("project_task_functionaltraining0")}) @@ -130,7 +138,12 @@ Add project's Work - !python {model: project.task.work}: | - 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")}) + vals = { + 'name': 'Technical Training', + 'hours': 0.0, + 'task_id': ref('project_task_technicaltraining0'), + } + 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")}) - Get project's Work - @@ -392,7 +405,7 @@ Check for remaining hours - !python {model: project.task}: | - self.onchange_remaining(cr, uid, [ref("project_task_functionaltraining0")], remaining = 0.0, planned = 0.0) + self.onchange_remaining(cr, uid, [ref("project_task_functionaltraining0")], remaining = 10.0, planned = False) - Close the task - @@ -460,6 +473,11 @@ After remove project task's work unlink it's details from the analytic account. - !python {model: account.analytic.account}: | + vals = { + 'name' : 'account_analytic_account', + 'partner_id': ref('base.res_partner_asus') + } + self.create(cr, uid, vals, context=None) self.unlink(cr, uid, [ref('account_analytic_account0')]) - Now, Close the project task @@ -501,6 +519,7 @@ - !python {model: project.task}: | self.do_cancel(cr, uid,[ref("project_task_functionaltraining0")],context={}) + self.action_close(cr, uid, [ref("project_task_functionaltraining0")], context=None) - Unlink this project's task. - @@ -511,3 +530,4 @@ - !python {model: project.project}: | self.unlink(cr, uid, [ref('project_project_testprogramme0')]) + From 18b57e8e65804cfc45832514e0f8aba9c68287d1 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Wed, 7 Sep 2011 10:27:47 +0530 Subject: [PATCH 22/36] [IMP]project: Improve the test cases bzr revid: dbr@tinyerp.com-20110907045747-3i7e2oroyrsole4t --- addons/project/test/test_project.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/project/test/test_project.yml b/addons/project/test/test_project.yml index 0ac1bc2ea85..c0adaa3c440 100644 --- a/addons/project/test/test_project.yml +++ b/addons/project/test/test_project.yml @@ -254,7 +254,7 @@ Now get the remaining hours required to close the task. - !python {model: project.task.reevaluate}: | - self._get_remaining(cr, uid) + self._get_remaining(cr, uid,{'active_id':ref('project_task_functionaltraining0') }) - | I click the apply button. - From ade1df97941df3334bdb541ea63224937be14c8e Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Wed, 7 Sep 2011 10:41:54 +0530 Subject: [PATCH 23/36] [IMP]project_gtd: Improve the test cases bzr revid: dbr@tinyerp.com-20110907051154-z3at9fzj88gcj8zk --- addons/project_gtd/test/gtd_test.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/addons/project_gtd/test/gtd_test.yml b/addons/project_gtd/test/gtd_test.yml index a4ff2529a1e..6ed11207dff 100644 --- a/addons/project_gtd/test/gtd_test.yml +++ b/addons/project_gtd/test/gtd_test.yml @@ -13,6 +13,12 @@ - !python {model: project.task}: | self.copy_data(cr, uid, ref("project_task_developtimemanagementmodule0"), default=None, context=None) +- + Set the different view types like form and search for this object +- + !python {model: project.task}: | + 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 - From 5e31814b639bdb69f85c3e41e945894abf5286ed Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Wed, 7 Sep 2011 12:36:35 +0530 Subject: [PATCH 24/36] [IMP]project: Remove extra space bzr revid: dbr@tinyerp.com-20110907070635-38vlay43z19ap7ma --- addons/project_gtd/test/gtd_test.yml | 46 +++--- .../test/phase_constraint.yml | 149 +++++++++--------- .../test/schedule_phase_tasks.yml | 34 ++-- .../test/test_schedule_tasks_case1.yml | 40 ++--- 4 files changed, 135 insertions(+), 134 deletions(-) diff --git a/addons/project_gtd/test/gtd_test.yml b/addons/project_gtd/test/gtd_test.yml index 6ed11207dff..35268cd49fd 100644 --- a/addons/project_gtd/test/gtd_test.yml +++ b/addons/project_gtd/test/gtd_test.yml @@ -1,6 +1,6 @@ -- +- Create a task 'Develop time management module' with monthly timebox -- +- !record {model: project.task, id: project_task_developtimemanagementmodule0}: name: Develop time management module planned_hours: 15.0 @@ -8,30 +8,30 @@ remaining_hours: 15.0 state: draft timebox_id: project_gtd.timebox_monthly -- +- Copy the task -- +- !python {model: project.task}: | self.copy_data(cr, uid, ref("project_task_developtimemanagementmodule0"), default=None, context=None) -- - Set the different view types like form and search for this object -- +- + Set the different view types like form and search for this object. +- !python {model: project.task}: | 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 -- +- !python {model: project.task}: | self.next_timebox(cr, uid, [ref("project_task_developtimemanagementmodule0")]) -- +- Change the time to previous -- +- !python {model: project.task}: | - self.prev_timebox(cr, uid, [ref("project_task_developtimemanagementmodule0")]) -- + self.prev_timebox(cr, uid, [ref("project_task_developtimemanagementmodule0")]) +- Open the task -- +- !python {model: project.task}: | self.do_open(cr, uid, [ref("project_task_developtimemanagementmodule0")], {"lang": "en_US", "project_id": False, "tz": False, "active_model": "ir.ui.menu", @@ -39,29 +39,29 @@ False, "search_default_user_id": 1, "search_default_current": 1, "active_ids": [ref("project.menu_action_view_task")], "active_id": ref("project.menu_action_view_task"), }) -- +- 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 -- +- !record {model: project.gtd.timebox, id: project_gtd_timebox_tomorrow1}: name: Tomorrow sequence: 0.0 -- +- Planify the task from monthly timebox to tomorrow timebox -- +- !record {model: project.timebox.fill.plan, id: project_timebox_fill_plan_0}: task_ids: - project_task_developtimemanagementmodule0 timebox_id: project_gtd.timebox_monthly timebox_to_id: project_gtd_timebox_tomorrow1 -- +- Set the task to tomorrow timebox -- +- !python {model: project.timebox.fill.plan}: | self._get_from_tb(cr, uid, context=None) self._get_to_tb(cr, uid, context=None) @@ -88,5 +88,5 @@ - 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}: + !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_long_term/test/phase_constraint.yml b/addons/project_long_term/test/phase_constraint.yml index b01d9c066bc..af15fc1a165 100644 --- a/addons/project_long_term/test/phase_constraint.yml +++ b/addons/project_long_term/test/phase_constraint.yml @@ -1,18 +1,18 @@ -- +- I have a project 'Develop yaml Project Module'. -- +- !record {model: project.project, id: project_project_developyamlproject0}: 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_hoursweeks0}: 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 -- +- !record {model: resource.calendar.attendance, id: resource_calendar_atendanceday1}: name: "Day1" hour_from : 09.00 @@ -20,29 +20,29 @@ dayofweek : "0" calendar_id : resource_calendar_hoursweeks0 -- +- 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" hour_from : 09.00 hour_to : 17.00 dayofweek : "1" calendar_id : resource_calendar_hoursweeks0 - -- + +- 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" hour_from : 09.00 hour_to : 17.00 - dayofweek : "2" + dayofweek : "2" calendar_id : resource_calendar_hoursweeks0 -- +- 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" hour_from : 09.00 @@ -50,66 +50,66 @@ dayofweek : "3" calendar_id : resource_calendar_hoursweeks0 -- +- 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" hour_from : 09.00 hour_to : 17.00 - dayofweek : "4" + dayofweek : "4" calendar_id : resource_calendar_hoursweeks0 -- +- Now Set working period to Project 'Develop yaml Project Module' -- - !python {model: project.project}: | +- + !python {model: project.project}: | context.update({'resource_calendar_id': ref("resource_calendar_hoursweeks0")}) self.write(cr, uid, [ref("project_project_developyamlproject0")], context) self.schedule_tasks(cr, uid, [ref('project_project_developyamlproject0')], context) - + for project in self.browse(cr, uid, [ref('project_project_developyamlproject0')], context): start_date = project.date_start end_date = start_date context.update({'start_date' : start_date,'end_date' : end_date}) 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. For that Creating a Analyst Human resource to analyst Project Yaml. -- +- !record {model: resource.resource, id: resource_resource_analyst1}: calendar_id: project_long_term.resource_calendar_hoursweeks0 name: Analyst resource_type: user time_efficiency: 1.0 user_id: base.user_admin - -- + +- Creating Developer Human resource who develop Yaml -- +- !record {model: resource.resource, id: resource_resource_develop0}: calendar_id: project_long_term.resource_calendar_hoursweeks0 name: Developer resource_type: user time_efficiency: 1.0 user_id: base.user_admin -- +- Creating a Tester Human resource for testing Yaml -- +- !record {model: resource.resource, id: resource_resource_tester1}: calendar_id: project_long_term.resource_calendar_hoursweeks0 name: tester resource_type: user time_efficiency: 1.0 user_id: base.user_admin - -- + +- Create 3 a project phase and NO one depends on other one. - so,they should start on the same day. + so,they should start on the same day. Creating First 'Analysis Flow for Yaml' Project Phase. -- +- !record {model: project.phase, id: project_phase_analysisflowforyaml0}: date_start: !eval time.strftime('%Y-%m-%d') duration: 6.0 @@ -119,19 +119,19 @@ responsible_id: project.res_users_analyst state: draft -- +- I update the Constrain Date Start adn Date End for phase Analysis Flow for Yaml -- +- !python {model : project.phase }: | import datetime from dateutil.relativedelta import * - start = datetime.date.today() - relativedelta(days=2) + start = datetime.date.today() - relativedelta(days=2) end = datetime.date.today() + relativedelta(days=6) self.write(cr,uid, [(ref("project_phase_analysisflowforyaml0"))], {'constraint_date_start': start, 'constraint_date_end':end}) - -- + +- Create project phase 'Develop yaml' with constraint date. -- +- !record {model: project.phase, id: project_phase_developyaml0}: duration: 6.0 name: Develop Yaml @@ -141,19 +141,19 @@ previous_phase_ids: - project_phase_analysisflowforyaml0 -- +- I update the Constrain Date Start adn Date End for phase Develop yaml -- +- !python {model : project.phase }: | import datetime from dateutil.relativedelta import * - start = datetime.date.today() - relativedelta(days=5) + start = datetime.date.today() - relativedelta(days=5) end = datetime.date.today() + relativedelta(days=10) 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' -- +- !record {model: project.phase, id: project_phase_testyaml0}: duration: 6.0 name: Testing Yaml @@ -161,24 +161,24 @@ project_id: project_project_developyamlproject0 previous_phase_ids: - project_phase_developyaml0 - constraint_date_start : - constraint_date_end : -- - Compute Schedule of phases For One project -- + constraint_date_start : + constraint_date_end : +- + 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" -- +- !python {model: project.project}: | self.schedule_phases(cr, uid, [ref("project_project_developyamlproject0")]) - + - - 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. + 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}: | proj=self.browse(cr, uid, [ref("project_project_developyamlproject0")])[0] @@ -186,28 +186,28 @@ for phase1 in proj.phase_ids: 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' -- +- !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' -- +- !python {model: project.phase}: | self.set_open(cr, uid, [ref("project_phase_developyaml0")]) -- +- Now, Compute the Total Hours -- +- !python {model: project.phase}: | field_name = 'test' - arg = {} + arg = {} self._compute(cr, uid, [ref("project_phase_developyaml0")], field_name, arg, context=None) -- +- Now, change the partner if needed -- +- !python {model: project.phase}: | for project in self.browse(cr, uid, [ref('project_phase_developyaml0')], context): project_id = project.project_id.id @@ -215,38 +215,39 @@ end_date = project.date_end context.update({'start_date' : start_date,'end_date' : end_date}) self.onchange_project(cr, uid, [ref("project_phase_developyaml0")], project_id,context) -- +- Now, Check start date. -- +- !python {model: project.phase}: | phase=self.browse(cr, uid, ref('project_phase_developyaml0'), context=context) + context.update({'project_id': ref('project_project_developyamlproject0')}) try: self._check_date_start(cr, uid, phase, context.get('end_date'), context) except: pass -- +- Now, Check end date. -- +- !python {model: project.phase}: | phase=self.browse(cr, uid, ref('project_phase_developyaml0'), context=context) + context.update({'project_id': ref('project_project_developyamlproject0')}) try: self._check_date_end(cr, uid, phase, context.get('start_date'), context) except: - pass -- + pass +- 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' -- +- !python {model: project.phase}: | self.set_done(cr, uid, [ref("project_phase_developyaml0")]) -- +- I am Cancelling the Phase 'Develop Yaml'. -- +- !python {model: project.phase}: | self.set_cancel(cr, uid, [ref("project_phase_developyaml0")]) - diff --git a/addons/project_long_term/test/schedule_phase_tasks.yml b/addons/project_long_term/test/schedule_phase_tasks.yml index be22f778cee..734eef7c974 100644 --- a/addons/project_long_term/test/schedule_phase_tasks.yml +++ b/addons/project_long_term/test/schedule_phase_tasks.yml @@ -1,6 +1,6 @@ -- +- Create project 'Develop an outlook-openerp synchronization plugin' -- +- !record {model: project.project, id: project_project_project4}: name: Develop an outlook-openerp synchronization plugin members: @@ -11,9 +11,9 @@ - project.res_users_tester - project.res_users_analyst - project.res_users_finacial_manager -- +- Create phase 'Develop GUI' in Outlook -- +- !record {model: project.phase, id: project_phase_phase0}: date_start: !eval time.strftime("%Y-%m-%d") duration: 200.0 @@ -27,10 +27,10 @@ - resource_id: project_long_term.resource_designer - resource_id: project_long_term.resource_tester - resource_id: project_long_term.resource_project_manager - -- + +- Create the phase task 'Develop GUI for Server Configuration' -- +- !record {model: project.task, id: project_task_t0}: name: Develop GUI for Server Configuration planned_hours: 20.0 @@ -39,10 +39,10 @@ phase_id: project_phase_phase0 project_id: project_project_project4 - -- + +- Create the phase task 'Develop GUI for Modules Configuration' -- +- !record {model: project.task, id: project_task_t1}: name: Develop GUI for Modules Configuration planned_hours: 25.0 @@ -51,9 +51,9 @@ phase_id: project_phase_phase0 project_id: project_project_project4 -- +- Create the phase task 'Develop GUI for OpenERP Synchronisation' -- +- !record {model: project.task, id: project_task_t2}: name: Develop GUI for OpenERP Synchronisation planned_hours: 30.0 @@ -62,9 +62,9 @@ phase_id: project_phase_phase0 project_id: project_project_project4 -- +- Create the phase task 'Design required GUI/Menus' -- +- !record {model: project.task, id: project_task_3}: name: Design required GUI/Menus planned_hours: 25.0 @@ -72,10 +72,10 @@ state: draft phase_id: project_phase_phase0 project_id: project_project_project4 - -- + +- Schedule phase tasks -- +- !python {model: project.phase}: | res = self.schedule_tasks(cr, uid, [ref("project_phase_phase0")]) diff --git a/addons/project_long_term/test/test_schedule_tasks_case1.yml b/addons/project_long_term/test/test_schedule_tasks_case1.yml index d40b61d6b3a..f5dd246b56b 100644 --- a/addons/project_long_term/test/test_schedule_tasks_case1.yml +++ b/addons/project_long_term/test/test_schedule_tasks_case1.yml @@ -1,8 +1,8 @@ - In order to test scheduling of tasks, I create four tasks with different sequences and schedule them. -- +- I create first user. -- +- !record {model: res.users, id: res_users_user0}: company_id: base.main_company context_lang: en_US @@ -12,9 +12,9 @@ login: user1 name: User 1 password: user1 -- +- I create second user. -- +- !record {model: res.users, id: res_users_user1}: company_id: base.main_company context_lang: en_US @@ -23,10 +23,10 @@ - base.group_user login: user2 name: User 2 - password: user2 -- + password: user2 +- I create a Project. -- +- !record {model: project.project, id: project_project_projecta0}: balance: 0.0 credit: 0.0 @@ -113,9 +113,9 @@ state: draft total_hours: 5.0 total_hours: 15.0 -- +- I create first task with highest sequence. -- +- !record {model: project.task, id: project_task_taska0}: delay_hours: 0.0 effective_hours: 0.0 @@ -126,9 +126,9 @@ sequence: 14 state: draft total_hours: 5.0 -- +- I create second task. -- +- !record {model: project.task, id: project_task_taskb0}: delay_hours: 0.0 effective_hours: 0.0 @@ -139,9 +139,9 @@ sequence: 13 state: draft total_hours: 5.0 -- +- I create third task. -- +- !record {model: project.task, id: project_task_taskc0}: delay_hours: 0.0 effective_hours: 0.0 @@ -154,7 +154,7 @@ total_hours: 5.0 - I create fourth task with lowest sequence. -- +- !record {model: project.task, id: project_task_taskd0}: delay_hours: 0.0 effective_hours: 0.0 @@ -164,25 +164,25 @@ remaining_hours: 5.0 state: draft total_hours: 5.0 -- +- Now I create a resource for first user. -- +- !record {model: resource.resource, id: resource_resource_user0}: name: User 1 resource_type: user time_efficiency: 1.0 user_id: res_users_user0 -- +- I create a resource for second user. -- +- !record {model: resource.resource, id: resource_resource_user1}: name: User 2 resource_type: user time_efficiency: 1.0 user_id: res_users_user1 -- +- Now I create one phase for the project. -- +- !record {model: project.phase, id: project_phase_phasea0}: date_start: '2011-01-06' duration: 2.0 From d0852a51457592c888a79800147c0fe56ef10e74 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Wed, 7 Sep 2011 14:05:05 +0530 Subject: [PATCH 25/36] [IMP]project : Improve the statements bzr revid: dbr@tinyerp.com-20110907083505-qqnu2lau4yl7fhvu --- addons/project/test/test_project.yml | 140 +++++++++--------- .../project/test/test_project_delegation.yml | 52 +++---- 2 files changed, 96 insertions(+), 96 deletions(-) diff --git a/addons/project/test/test_project.yml b/addons/project/test/test_project.yml index c0adaa3c440..b6a081dc659 100644 --- a/addons/project/test/test_project.yml +++ b/addons/project/test/test_project.yml @@ -4,21 +4,21 @@ !record {model: res.users, id: base.user_root}: user_email: admin@openerp.com - - Now, Test project template feature + I test project template feature - - 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 name: OpenERP Training Programm - - Create analytic account. + I create analytic account. - !record {model: account.analytic.account, id: account_analytic_account0}: name : account_analytic_account partner_id: base.res_partner_asus - - 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') - - 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 - - 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 - - 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 - - Set project's task view + I set project's task view - !python {model: project.task}: | context.update({'project_id': ref('project_task_functionaltraining0')}) @@ -69,63 +69,63 @@ self.fields_view_get(cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False) self.action_close - - Click on Draft button. + I click on Draft button. - !python {model: project.task}: | self.do_draft(cr, uid, [ref("project_task_functionaltraining0")], context={}) - - Click on Start task button. + I click on Start task button. - !python {model: project.task}: | self.do_open(cr, uid,[ref("project_task_functionaltraining0")],context={}) - - Click Pending button + I click Pending button - !python {model: project.task}: | self.do_pending(cr, uid, [ref("project_task_functionaltraining0")], context={}) - - Click on Start task button. + I click on Start task button. - !python {model: project.task}: | self.do_open(cr, uid,[ref("project_task_functionaltraining0")],context={}) - - Check child project. + I check child project. - !python {model: project.task}: | self._check_child_task(cr, uid, [ref("project_task_functionaltraining0")]) - - Do some changes on project without define partner. + I do some changes on project without define partner. - !python {model: project.task}: | self.onchange_project(cr, uid, [ref("project_task_functionaltraining0")],[]) - - Do some changes on project. + I do some changes on project. - !python {model: project.task}: | self.onchange_project(cr, uid, [ref("project_task_functionaltraining0")],ref('project_project_openerptrainingprogramme0')) - - Change the type of project. + I change the type of project. - !python {model: project.task}: | self._change_type(cr, uid,[ref("project_task_functionaltraining0")], next, context) - - Click on next Button for change the type of project task. + I click on next Button for change the type of project task. - !python {model: project.task}: | self.next_type(cr, uid,[ref("project_task_functionaltraining0")], context) - - Click on previous Button for go back to previous type of task. + I click on previous Button for go back to previous type of task. - !python {model: project.task}: | self.prev_type(cr, uid,[ref("project_task_functionaltraining0")], context) - - Create work for project's task. + I create work for project's task. - !record {model: project.task.work, id: project_task_work0}: name: Technical Training Task's Work task_id: project_task_technicaltraining0 - - 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")}) - - Add project's Work + I add project's Work - !python {model: project.task.work}: | vals = { @@ -145,29 +145,29 @@ } 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")}) - - 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")}) - - Change the project's partner if needed. + I change the project's partner if needed. - !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")}) - - 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"), }) - - 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" - - 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 - - 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,12 +189,12 @@ "ir.ui.menu", "project_id": False, "active_id": ref("project.menu_open_view_project_all"), }) - - 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" - - Test for different project-states + I test for different project-states - Keep project pending - @@ -204,12 +204,12 @@ "ir.ui.menu", "project_id": False, "active_id": ref("project.menu_open_view_project_all"), }) - - 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" - - 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,7 +217,7 @@ "ir.ui.menu", "project_id": False, "active_id": ref("project.menu_open_view_project_all"), }) - - 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" @@ -234,19 +234,19 @@ !assert {model: project.project, id: project_project_openerptrainingprogramme0, severity: error, string: Project is in open state}: - state == "open" - - 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 - | - Create the view for reevaluate the task. + I create the view for reevaluate the task. - !python {model: project.task.reevaluate}: | self.fields_view_get(cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False) @@ -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}) - | - 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 - - Make 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 - - 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 - - Make 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 - - 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 - - Make 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 - - 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 - - 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 - - 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"), }) - - 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 - - Make 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,26 +346,26 @@ name: Training on reports and wizards user_id: base.user_root - - 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 - - Close the task + I close the task - !python {model: project.task}: | self.do_close(cr, uid, [ref("project_task_technicaltraining0")], {'mail_send': False}) - - 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" - - Test for task reactivation + I test for task reactivation - - Reactivate task + I reactivate task - !record {model: project.task.reevaluate, id: config_compute_remaining_1}: remaining_hours: 10.0 @@ -379,14 +379,14 @@ 1, "search_default_current": 1, "active_ids": [ref("project_task_technicaltraining0")], "active_id": ref("project_task_technicaltraining0"), }) - - 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 - - Make 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,7 +395,7 @@ name: Training on yml user_id: base.user_root - - 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 @@ -407,24 +407,24 @@ !python {model: project.task}: | self.onchange_remaining(cr, uid, [ref("project_task_functionaltraining0")], remaining = 10.0, planned = False) - - Close the task + I close the task - !python {model: project.task}: | self.do_close(cr, uid, [ref("project_task_technicaltraining0")], {'mail_send': False}) - - 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" - - 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 - - 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 - - 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) - - 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,12 +460,12 @@ self.set_done(cr, uid, [ref("project_project_openerptrainingprogramme0")], context=context) - - 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" - - Unlink the task's work. + Now, unlink the task's work. - !python {model: project.task.work}: | self.unlink(cr, uid, [ref('project_task_work0')]) @@ -480,7 +480,7 @@ self.create(cr, uid, vals, context=None) self.unlink(cr, uid, [ref('account_analytic_account0')]) - - Now, Close the project task + I close the project task - !record {model: project.task.close, id: project_task_close_0}: manager_warn : True @@ -489,7 +489,7 @@ partner_email : 'info@myinfobid.com' description : Description - - Send Warn Message by Email to Manager and Customer. + I send Warn Message by Email to Manager and Customer. - !python {model: project.task.close}: | fields = { @@ -505,28 +505,28 @@ except : pass - - 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) - - Change the planned. + I change the planned. - !python {model: project.task}: | self.onchange_planned(cr, uid, [ref("project_task_functionaltraining0")], planned = 0.0, effective = 0.0) - - Cancel this project. + I cancel this project. - !python {model: project.task}: | self.do_cancel(cr, uid,[ref("project_task_functionaltraining0")],context={}) self.action_close(cr, uid, [ref("project_task_functionaltraining0")], context=None) - - Unlink this project's task. + Now, unlink this project's task. - !python {model: project.task}: | self.unlink(cr, uid,[ref("project_task_functionaltraining0")]) - - Unlink the project. + Now, unlink the project. - !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 df039965523..9501e8f9b48 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. - - Creating a project OpenERP Documentation + I creating a project OpenERP Documentation - !record {model: project.project, id: project_project_openerpdocumentation0}: company_id: base.main_company name: OpenERP Documentation - - Creating a task 'Develop book for Technical and Functional reference' + I 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 @@ -17,14 +17,14 @@ remaining_hours: 20.0 state: pending - - 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"), }) - - Creating a task 'Publish the References' + I creating a task 'Publish the References' - !record {model: project.task, id: project_task_publish_book}: name: Publish the References @@ -34,7 +34,7 @@ state: draft - - 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"), }) - - Test the delegate wizard + I test the delegate wizard - - Creating a delegate task 'Publish the References' of 15 hours, renaming parent task to 'CHECK Publish the References' of 1 hour + I am creating 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 @@ -55,7 +55,7 @@ state: pending user_id: base.user_demo - - Create view for delegate task. + I create view for delegate task. - !python {model: project.task.delegate}: | fields = { @@ -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) - - Validating the delegate task. + I am validating 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")}) - - 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" - - Creating a delegate task 'Prepare a book that gives functional overview of OpenERP' + I am 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 @@ -91,7 +91,7 @@ state: draft - - 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"), }) - - Creating a delegate task 'Prepare a technical reference for creating your modules' + I am 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 @@ -109,7 +109,7 @@ state: draft - - 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"), }) - - 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 - - Creating a delegate task 'Prepare documentation for Module Development' + I am 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 @@ -138,7 +138,7 @@ - - Creating a delegate 'Prepare documentation for Business Process Development' + I am 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 @@ -148,7 +148,7 @@ state: draft - - 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 - - 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"), }) - - 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"), }) - - 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" - - 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 @@ }) - - 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", @@ -206,13 +206,13 @@ - - 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" - - 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 @@ }) - - 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", From 0c755d3a52268855bddb3fc29104a303ab7d7083 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Wed, 7 Sep 2011 14:52:42 +0530 Subject: [PATCH 26/36] [IMP]project_* : Improve the statements bzr revid: dbr@tinyerp.com-20110907092242-3d0ja7ffus1x59ha --- addons/project/test/test_project.yml | 113 +++++++++-------- .../project/test/test_project_delegation.yml | 54 ++++---- addons/project_gtd/test/gtd_test.yml | 24 ++-- .../test/convert_issue_to_task.yml | 34 +++--- .../test/test_project_issue_states.yml | 76 ++++++------ .../test/phase_constraint.yml | 49 ++++---- .../test/project_schedule_consecutive_day.yml | 115 +++++++++--------- .../project_schedule_without_wroking_hour.yml | 54 ++++---- .../test/schedule_phase_tasks.yml | 16 +-- .../test/schedule_project_phases.yml | 42 +++---- .../test/schedule_project_tasks.yml | 56 ++++----- .../test/test_schedule_phases_case1.yml | 10 +- .../test/test_schedule_phases_case2.yml | 67 +++++----- 13 files changed, 351 insertions(+), 359 deletions(-) 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")]) - From 5cbd017b190a48a39e98a986f7ac6a97fb27d363 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Wed, 7 Sep 2011 15:06:59 +0530 Subject: [PATCH 27/36] [IMP]project_* : Improve the statements bzr revid: dbr@tinyerp.com-20110907093659-iwkovt45beo4pzl5 --- .../test/project_task_procurement.yml | 12 +-- .../project_planning/test/planning_states.yml | 96 +++++++++---------- .../test/project_planning_report.yml | 4 +- .../test/deadline_change.yml | 12 +-- .../test/project_scrum_report.yml | 48 +++++----- .../project_scrum/test/scrum_sprint_test.yml | 10 +- .../worktask_entry_to_timesheetline_entry.yml | 28 +++--- 7 files changed, 105 insertions(+), 105 deletions(-) diff --git a/addons/project_mrp/test/project_task_procurement.yml b/addons/project_mrp/test/project_task_procurement.yml index 70efa444fba..e78681ba1df 100644 --- a/addons/project_mrp/test/project_task_procurement.yml +++ b/addons/project_mrp/test/project_task_procurement.yml @@ -1,5 +1,5 @@ - - In order to test project_mrp module with OpenERP I want to create sale orders + In order to test project_mrp module with OpenERP I want to create sale orders with product type 'service' so when procurement runs one task is created. - I create record for a service type product. @@ -15,9 +15,9 @@ uom_id: product.uom_day uom_po_id: product.uom_day warranty: 0.0 -- +- I create a sale order for product Partners Training which has type 'Service'. -- +- !record {model: sale.order, id: sale_order_so0}: date_order: !eval time.strftime('%Y-%m-%d') invoice_quantity: order @@ -64,15 +64,15 @@ - !python {model: project.task}: | order_obj = self.pool.get('sale.order') - order = order_obj.browse(cr, uid, ref('sale_order_so0')) - task_id = self.search(cr, uid, [('name','like', order.name)]) + order = order_obj.browse(cr, uid, ref('sale_order_so0')) + task_id = self.search(cr, uid, [('name','like', order.name)]) assert task_id, 'No Task is created!' - Now I am Closing the Created Task Vis Procurment . - !python {model: project.task}: | order_obj = self.pool.get('sale.order') - order = order_obj.browse(cr, uid, ref('sale_order_so0')) + order = order_obj.browse(cr, uid, ref('sale_order_so0')) task_id = self.search(cr, uid, [('name','like', order.name)]) if task_id: self.do_close(cr, uid, task_id) diff --git a/addons/project_planning/test/planning_states.yml b/addons/project_planning/test/planning_states.yml index 5c9cf717bd9..88141675df7 100644 --- a/addons/project_planning/test/planning_states.yml +++ b/addons/project_planning/test/planning_states.yml @@ -1,6 +1,6 @@ -- - Create a analytic planning 'Project Planning' -- +- + I create a analytic planning 'Project Planning'. +- !record {model: report_account_analytic.planning, id: report_account_analytic_planning_projectplanning0}: business_days: 20 date_from: !eval time.strftime('%Y-%m-%d') @@ -8,11 +8,11 @@ name: Project Planning state: draft user_id: base.user_demo - - -- - Open the 'Project Planning' -- + + +- + Open the 'Project Planning'. +- !python {model: report_account_analytic.planning}: | self.action_open(cr, uid, [ref("report_account_analytic_planning_projectplanning0")], {"lang": "en_US", "active_ids": [ref("project_planning.menu_report_account_analytic_planning")], @@ -20,14 +20,14 @@ ref("project_planning.menu_report_account_analytic_planning"), "search_default_user_id": 1, "project_id": False, "department_id": False, }) - - Check if 'Project Planning' in open state + I check if 'Project Planning' in open state. - - !assert {model: report_account_analytic.planning, id: report_account_analytic_planning_projectplanning0, string: Planning in open state}: + !assert {model: report_account_analytic.planning, id: report_account_analytic_planning_projectplanning0, string: Planning in open state}: - state == "open" -- - Cancel the 'Project Planning' -- +- + I cancel the 'Project Planning'. +- !python {model: report_account_analytic.planning}: | self.action_cancel(cr, uid, [ref("report_account_analytic_planning_projectplanning0")], {"lang": "en_US", "active_ids": [ref("project_planning.menu_report_account_analytic_planning")], @@ -35,14 +35,14 @@ ref("project_planning.menu_report_account_analytic_planning"), "search_default_user_id": 1, "project_id": False, "department_id": False, }) - - Check if 'Project Planning' in cancel state + I check if 'Project Planning' in cancel state. +- + !assert {model: report_account_analytic.planning, id: report_account_analytic_planning_projectplanning0, string: Planning in cancel state}: + - state == "cancel" + +- + Reopen the 'Project Planning'. - - !assert {model: report_account_analytic.planning, id: report_account_analytic_planning_projectplanning0, string: Planning in cancel state}: - - state == "cancel" - -- - Reopen the 'Project Planning' -- !python {model: report_account_analytic.planning}: | self.action_draft(cr, uid, [ref("report_account_analytic_planning_projectplanning0")], {"lang": "en_US", "active_ids": [ref("project_planning.menu_report_account_analytic_planning")], @@ -50,14 +50,14 @@ ref("project_planning.menu_report_account_analytic_planning"), "search_default_user_id": 1, "project_id": False, "department_id": False, }) - - Check if 'Project Planning' in draft state + I check if 'Project Planning' in draft state. +- + !assert {model: report_account_analytic.planning, id: report_account_analytic_planning_projectplanning0, string: Planning in draft state}: + - state == "draft" + +- + Open the 'Project Planning'. - - !assert {model: report_account_analytic.planning, id: report_account_analytic_planning_projectplanning0, string: Planning in draft state}: - - state == "draft" - -- - Open the 'Project Planning' -- !python {model: report_account_analytic.planning}: | self.action_open(cr, uid, [ref("report_account_analytic_planning_projectplanning0")], {"lang": "en_US", "active_ids": [ref("project_planning.menu_report_account_analytic_planning")], @@ -65,14 +65,14 @@ ref("project_planning.menu_report_account_analytic_planning"), "search_default_user_id": 1, "project_id": False, "department_id": False, }) - - Check if 'Project Planning' in open state + I check if 'Project Planning' in open state. +- + !assert {model: report_account_analytic.planning, id: report_account_analytic_planning_projectplanning0, string: Planning in open state}: + - state == "open" + +- + I close the 'Project Planning'. - - !assert {model: report_account_analytic.planning, id: report_account_analytic_planning_projectplanning0, string: Planning in open state}: - - state == "open" - -- - Close the 'Project Planning' -- !python {model: report_account_analytic.planning}: | self.action_done(cr, uid, [ref("report_account_analytic_planning_projectplanning0")], {"lang": "en_US", "active_ids": [ref("project_planning.menu_report_account_analytic_planning")], @@ -82,32 +82,32 @@ name = 'Project Planning' self._get_total_planned(cr, uid, [ref("report_account_analytic_planning_projectplanning0")], name, args={},context=None) self._get_total_free(cr, uid, [ref("report_account_analytic_planning_projectplanning0")], name, args={},context=None) -- - Create analytic planning report -- +- + I create analytic planning report. +- !record {model: report_account_analytic.planning.line, id: report_account_analytic_planning_line}: planning_id : report_account_analytic_planning_projectplanning0 amount : 100 amount_unit : product.product_uom_unit -- - Create account analytic report for planning 'Project Planning' -- +- + I create account analytic report for planning 'Project Planning'. +- !python {model: report_account_analytic.planning.line}: | self.name_get(cr, uid, [ref("report_account_analytic_planning_line")],context=None) -- +- Add project line id in project task report. -- +- !record {model: project.task, id: report_account_analytic_planning_line}: planning_line_id: report_account_analytic_planning_line -- - Now, search palnning for the task -- +- + Now, search palnning for the task. +- !python {model: project.task}: | context.update({'planning' : ref("report_account_analytic_planning_projectplanning0")}) self.search(cr, uid, args={}, offset=0, limit=None, order=None, context=context, count=False) - - Check if 'Project Planning' in done state + I check if 'Project Planning' in done state. - - !assert {model: report_account_analytic.planning, id: report_account_analytic_planning_projectplanning0, string: Planning in done state}: - - state == "done" + !assert {model: report_account_analytic.planning, id: report_account_analytic_planning_projectplanning0, string: Planning in done state}: + - state == "done" diff --git a/addons/project_planning/test/project_planning_report.yml b/addons/project_planning/test/project_planning_report.yml index a7597af86e8..63420366c74 100644 --- a/addons/project_planning/test/project_planning_report.yml +++ b/addons/project_planning/test/project_planning_report.yml @@ -1,8 +1,8 @@ - - In order to test the PDF reports defined on a Project Planning, we will print Project Planning Report + In order to test the PDF reports defined on a Project Planning, we will print Project Planning Report. - !python {model: report_account_analytic.planning}: | import netsvc, tools, os (data, format) = netsvc.LocalService('report.report_account_analytic.planning.print').create(cr, uid, [ref('project_planning.project_plannning_1')], {}, {}) if tools.config['test_report_directory']: - file(os.path.join(tools.config['test_report_directory'], 'project_planning-project_planning_report'+format), 'wb+').write(data) \ No newline at end of file + file(os.path.join(tools.config['test_report_directory'], 'project_planning-project_planning_report'+format), 'wb+').write(data) diff --git a/addons/project_retro_planning/test/deadline_change.yml b/addons/project_retro_planning/test/deadline_change.yml index 33f7d44ccaa..7d182e35739 100644 --- a/addons/project_retro_planning/test/deadline_change.yml +++ b/addons/project_retro_planning/test/deadline_change.yml @@ -1,13 +1,13 @@ -- - Create project 'Retro Planning' -- +- + I create project 'Retro Planning'. +- !record {model: project.project, id: project_project_retroplanning0}: company_id: base.main_company date: !eval time.strftime('%Y-%m-%d') name: Retro Planning -- - Create task 'Plan all projects' -- +- + I create task 'Plan all projects'. +- !record {model: project.task, id: project_task_planallprojects0}: date_deadline: !eval "'%s-%s-%s' %(datetime.now().year,datetime.now().month,6)" date_end: !eval "'%s-%s-%s %s:%s:%s' %(datetime.now().year,datetime.now().month,3,datetime.now().hour,datetime.now().minute,datetime.now().second)" diff --git a/addons/project_scrum/test/project_scrum_report.yml b/addons/project_scrum/test/project_scrum_report.yml index d7c5b43454a..e4bd785e542 100644 --- a/addons/project_scrum/test/project_scrum_report.yml +++ b/addons/project_scrum/test/project_scrum_report.yml @@ -4,15 +4,15 @@ !record {model: res.users, id: base.user_root}: user_email: admin@openerp.com - - Test project template feature + Test project template feature. - - Create project 'OpenERP Training Programme' + I create project 'OpenERP Training Programme'. - !record {model: project.project, id: project_project_0}: company_id: base.main_company name: OpenERP Training Test - - In order to test the PDF reports defined on a Project Scrum, we will print Project Scrum Sprint Burndown Report + In order to test the PDF reports defined on a Project Scrum, we will print Project Scrum Sprint Burndown Report. - !python {model: project.scrum.sprint}: | import netsvc, tools, os @@ -21,7 +21,7 @@ if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'project_scrum-project_scrum_sprint_burndown.'+format), 'wb+').write(data) - - Creating a project.scrum.product.backlog record + I create a project.scrum.product.backlog record. - !record {model: project.scrum.product.backlog, id: project_scrum_product_backlog0}: effective_hours: 0.0 @@ -37,28 +37,28 @@ self.name_search(cr, uid, name='test', args=None, operator='ilike', context=None, limit=100) self.button_draft(cr, uid, [ref("project_scrum_product_backlog0")],context=None) - - Click on Open Button. + I click on Open Button. - !python {model: project.scrum.product.backlog}: | self.button_open(cr, uid, [ref("project_scrum_product_backlog0")],context=None) - - Click on Pending Button. + I click on Pending Button. - !python {model: project.scrum.product.backlog}: | self.button_pending(cr, uid, [ref("project_scrum_product_backlog0")],context=None) - - Click on Open Button. + I click on Open Button. - !python {model: project.scrum.product.backlog}: | self.button_open(cr, uid, [ref("project_scrum_product_backlog0")],context=None) - - Creating a project.scrum.meeting record. + I create a project.scrum.meeting record. - !record {model: project.scrum.meeting, id: project_scrum_meeting_0}: date: !eval time.strftime('%Y-%m-%d') sprint_id: project_scrum.scrum_sprint_0 - - In order to test the Scrum meeting + In order to test the Scrum meeting. - !python {model: project.scrum.meeting}: | try: @@ -67,13 +67,13 @@ except: pass - - Creating a project.scrum.email record. + I create a project.scrum.email record. - !record {model: project.scrum.email, id: project_scrum_email_0}: subject: Subject message: test message - - Send project scrum email + Send project scrum email. - !python {model: project.scrum.email}: | fields={ @@ -87,12 +87,12 @@ except: pass - - Creating first scrum backlog for merge the record. + I create first scrum backlog for merge the record. - !record {model: project.scrum.backlog.merge, id: project_scrum_backlog_merge1}: project_id: project_project_0 - - Creating second scrum backlog for merge the record. + I create second scrum backlog for merge the record. - !record {model: project.scrum.backlog.merge, id: project_scrum_backlog_merge2}: project_id: project_project_0 @@ -107,19 +107,19 @@ except: pass - - In order to test the project_scrum_backlog_create_task wizard + In order to test the project_scrum_backlog_create_task wizard. - !record {model: project.scrum.backlog.create.task, id: project_scrum_backlog_task0}: user_id: base.user_root - - Set project as project template + Set project as project template. - !python {model: project.scrum.backlog.create.task}: | context['active_ids'] = [ref("project_scrum_backlog_task0")] self.do_create(cr, uid, [ref("project_scrum_backlog_task0")],context) - - Creating a ScrumProduct Backlog Record. + I create a ScrumProduct Backlog Record. - !record {model: project.scrum.product.backlog, id: project_scrum_product_demobacklog0}: effective_hours: 0.0 @@ -129,8 +129,8 @@ sequence: 0.0 - - Creating a postpone.wizard record. -- + I create a postpone.wizard record. +- !record {model: postpone.wizard, id: postpone_wizard_0}: {} - @@ -139,25 +139,25 @@ !python {model: postpone.wizard}: | context['active_ids'] = [ref("project_scrum_product_demobacklog0")] context['active_id'] = [ref("postpone_wizard_0")] - self.button_postpone( cr, uid, [ref("postpone_wizard_0")], context=context) + self.button_postpone( cr, uid, [ref("postpone_wizard_0")], context=context) - - Click on Postpone Button. + I click on Postpone Button. - !python {model: project.scrum.product.backlog}: | self.button_postpone(cr, uid, [ref("project_scrum_product_backlog0")],context=None) - - Click on Close Button. + I click on Close Button. - !python {model: project.scrum.product.backlog}: | self.button_close(cr, uid, [ref("project_scrum_product_backlog0")],context=None) - - Click on Cancel Button. + I click on Cancel Button. - !python {model: project.scrum.product.backlog}: | self.button_cancel(cr, uid, [ref("project_scrum_product_backlog0")],context=None) - - Create a backlog sprint -- + I create a backlog sprint. +- !record {model: project.scrum.backlog.assign.sprint, id: project_scrum_backlog_assign_sprint}: {} - diff --git a/addons/project_scrum/test/scrum_sprint_test.yml b/addons/project_scrum/test/scrum_sprint_test.yml index 083c2faca18..5ed0c9212c7 100644 --- a/addons/project_scrum/test/scrum_sprint_test.yml +++ b/addons/project_scrum/test/scrum_sprint_test.yml @@ -1,5 +1,5 @@ - - Creating a Scrum Sprint Record + I create a Scrum Sprint Record. - !record {model: project.scrum.sprint, id: project_scrum_sprint_testsprint0}: date_start: !eval time.strftime('%Y-%m-01') @@ -10,24 +10,24 @@ scrum_master_id: base.user_admin state: draft - - I am copying the "Demo Sprint" Sprint + I am copying the "Demo Sprint" Sprint. - !python {model: project.scrum.sprint}: | self.copy(cr, uid, ref("project_scrum_sprint_testsprint0")) - - I am changing the Project of the "Demo Sprint" Sprint + I am changing the Project of the "Demo Sprint" Sprint. - !python {model: project.scrum.sprint}: | self.onchange_project_id(cr, uid, [ref("project_scrum_sprint_testsprint0")], ref("project.project_project_9")) - - I am Opeing the "Demo Sprint" Sprint + I am Opeing the "Demo Sprint" Sprint. - !python {model: project.scrum.sprint}: | self.button_open(cr, uid, [ref("project_scrum_sprint_testsprint0")]) - - I am Setting the "Demo Sprint" Sprint to Pending + I am Setting the "Demo Sprint" Sprint to Pending. - !python {model: project.scrum.sprint}: | self.button_pending(cr, uid, [ref("project_scrum_sprint_testsprint0")]) diff --git a/addons/project_timesheet/test/worktask_entry_to_timesheetline_entry.yml b/addons/project_timesheet/test/worktask_entry_to_timesheetline_entry.yml index a8a4bae06fe..bc2827ff4cc 100644 --- a/addons/project_timesheet/test/worktask_entry_to_timesheetline_entry.yml +++ b/addons/project_timesheet/test/worktask_entry_to_timesheetline_entry.yml @@ -1,5 +1,5 @@ - - Create a user 'HR Manager' + I create a user 'HR Manager'. - !record {model: res.users, id: res_users_hrmanager0}: company_id: base.main_company @@ -11,7 +11,7 @@ - base.group_hr_manager - - Create a product with type service used to specify employees designation + I create a product with type service used to specify employees designation. - !record {model: product.product, id: product_product_hrmanger0}: categ_id: product.product_category_services @@ -30,7 +30,7 @@ weight_net: 0.0 - - Create an analytic journal for employees timesheet + I create an analytic journal for employees timesheet. - !record {model: account.analytic.journal, id: account_analytic_journal_hrtimesheet0}: company_id: base.main_company @@ -38,7 +38,7 @@ type: general - - Create an employee 'HR Manager' for user 'HR Manager' + I create an employee 'HR Manager' for user 'HR Manager'. - !record {model: hr.employee, id: hr_employee_hrmanager0}: name: HR Manager @@ -47,7 +47,7 @@ journal_id: account_analytic_journal_hrtimesheet0 - - Create a timesheet sheet for HR manager + I create a timesheet sheet for HR manager. - !record {model: hr_timesheet_sheet.sheet, id: hr_timesheet_sheet_sheet_sheetforhrmanager0}: date_current: !eval time.strftime('%Y-05-%d') @@ -59,20 +59,20 @@ employee_id : 'hr_employee_hrmanager0' - - Create a project 'Timesheet Management' + I create a project 'Timesheet Management'. - !record {model: project.project, id: project_project_timesheetmanagement0}: company_id: base.main_company name: Timesheet Management - - Change the partner to the realted project + I change the partner to the realted project. - !python {model: project.project}: | self.onchange_partner_id(cr, uid, [ref('project_project_timesheetmanagement0')], part=False, context=None) - - Create a task 'Get all timesheet records' + I create a task 'Get all timesheet records'. - !record {model: project.task, id: project_task_getalltimesheetrecords0}: date_start: !eval time.strftime('%Y-05-%d %H:%M:%S') @@ -84,7 +84,7 @@ user_id: res_users_hrmanager0 - - Open the task + Open the task. - !python {model: project.task}: | self.do_open(cr, uid, [ref("project_task_getalltimesheetrecords0")], {"lang": @@ -94,7 +94,7 @@ self.write(cr, uid, [ref('project_task_getalltimesheetrecords0')], {'name': 'Get all timesheet records','project_id': ref('project_project_timesheetmanagement0'),'user_id': ref('res_users_hrmanager0')},context) - - Make a work task entry 'Get work calendar of all employees' of 10 hours done by HR manager + Make a work task entry 'Get work calendar of all employees' of 10 hours done by HR manager. - !record {model: project.task, id: project_task_getalltimesheetrecords0}: work_ids: @@ -103,7 +103,7 @@ name: Get work calendar of all employees user_id: res_users_hrmanager0 - - Creating a project.task.work record + I create a project.task.work record. - !record {model: project.task.work, id: project_task_work_test0}: company_id: base.main_company @@ -113,7 +113,7 @@ task_id: project_task_getalltimesheetrecords0 user_id: res_users_hrmanager0 - - Add the work details + Add the work details. - !python {model: project.task.work}: | import time @@ -130,12 +130,12 @@ self.write(cr, uid, [ref('project_task_work_test0')], vals,context) self.unlink(cr, uid, [ref('project_task_work_test0')]) - - Check for timesheet_ids in HR manager's timesheet + I check for timesheet_ids in HR manager's timesheet. - !assert {model: hr_timesheet_sheet.sheet, id: hr_timesheet_sheet_sheet_sheetforhrmanager0, string: After hr manager's work task, length of timesheet line of current timesheet must be greater then 1}: - len(timesheet_ids) > 0 - - Unlink the task + Unlink the task. - !python {model: project.task}: | self.unlink(cr, uid, [ref("project_task_getalltimesheetrecords0")]) From 93d91ddaa91ff4825bd73fad8fe5696a11af431f Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Thu, 8 Sep 2011 11:57:41 +0530 Subject: [PATCH 28/36] [ADD]project_issue_sheet: Add the test file bzr revid: dbr@tinyerp.com-20110908062741-0k1e8zv5yzxt6b4z --- addons/project_issue_sheet/__openerp__.py | 1 + .../test/test_project_issue_sheet.yml | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 addons/project_issue_sheet/test/test_project_issue_sheet.yml diff --git a/addons/project_issue_sheet/__openerp__.py b/addons/project_issue_sheet/__openerp__.py index cc1cd6504b0..bf9e23fdb77 100644 --- a/addons/project_issue_sheet/__openerp__.py +++ b/addons/project_issue_sheet/__openerp__.py @@ -45,6 +45,7 @@ Worklogs can be maintained to signify number of hours spent by users to handle a ], 'demo_xml': [ ], + 'test': ['test/test_project_issue_sheet.yml'], 'installable': True, 'active': False, 'certificate' : '00856032058128997037', diff --git a/addons/project_issue_sheet/test/test_project_issue_sheet.yml b/addons/project_issue_sheet/test/test_project_issue_sheet.yml new file mode 100644 index 00000000000..be06baadeb6 --- /dev/null +++ b/addons/project_issue_sheet/test/test_project_issue_sheet.yml @@ -0,0 +1,28 @@ +- + I create analytic account. +- + !record {model: account.analytic.account, id: account_analytic_account1}: + name : account_analytic_account + partner_id: base.res_partner_asus +- + I create a project issue. +- + !record {model: project.issue, id: project_issue_onchangeevent1}: + categ_id: project_issue.bug_categ + date_open: !eval time.strftime('%Y-%m-%d') + name: on_change event does not pass context to the method + project_id: project.project_project_22 + working_hours_close: 0.0 + working_hours_open: 0.0 +- + I change the project. +- + !python {model: project.issue}: | + project_id = ref('project.project_project_21') + self.on_change_project(cr, uid, [ref('project_issue_onchangeevent1')], project_id, context) +- + I add analytic account. +- + !python {model: project.issue}: | + account_id = ref('account_analytic_account1') + self.on_change_account_id(cr, uid, [ref('project_issue_onchangeevent1')], account_id, context) From 319675014cc8baa72b428ebc1f8dd73d0a6324ae Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Thu, 8 Sep 2011 12:42:04 +0530 Subject: [PATCH 29/36] [ADD]project_caldav: Add the test file bzr revid: dbr@tinyerp.com-20110908071204-1rtvl8o6wkbzrhg6 --- addons/project_caldav/__openerp__.py | 1 + .../test/test_project_caldav.yml | 59 +++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 addons/project_caldav/test/test_project_caldav.yml diff --git a/addons/project_caldav/__openerp__.py b/addons/project_caldav/__openerp__.py index 29c9ec4d483..838914ba9e6 100644 --- a/addons/project_caldav/__openerp__.py +++ b/addons/project_caldav/__openerp__.py @@ -34,6 +34,7 @@ on a remote server. "depends": ["project", "caldav", "base_calendar"], "init_xml": ["project_caldav_data.xml", 'project_caldav_setup.xml', ], "demo_xml": [], + "test": ['test/test_project_caldav.yml'], "update_xml": ["project_caldav_view.xml"], "active": False, "website": "http://www.openerp.com", diff --git a/addons/project_caldav/test/test_project_caldav.yml b/addons/project_caldav/test/test_project_caldav.yml new file mode 100644 index 00000000000..3ed1e6f38ec --- /dev/null +++ b/addons/project_caldav/test/test_project_caldav.yml @@ -0,0 +1,59 @@ +- | + Now Create test cases for project caldav +- + I create task 'Training task' for this project. +- + !record {model: project.task, id: project_task_technicaltasktraining}: + date_start: !eval time.strftime('%Y-%m-%d %H:%M:%S') + name: Technical Training + user_id: base.user_root + planned_hours: 30.0 + date_deadline: !eval time.strftime('%Y-%m-%d 20:20:00') + remaining_hours: 30.0 + state: draft +- + Open the created task. +- + !python {model: project.task}: | + context.update({'model':'project.task','active_id': ref('project_task_technicaltasktraining')}) + self.open_task(cr, uid, [ref('project_task_technicaltasktraining')], context) +- + Check the export functionality. +- + !python {model: project.task}: | + context.update({'model':'project.task','active_id': ref('project_task_technicaltasktraining')}) + self.export_cal(cr, uid, [ref('project_task_technicaltasktraining')], context) +- + Check the Import functionality with the define date. +- + !python {model: project.task}: | + import time + vals = [] + context.update({'model':'project.task','active_id': ref('project_task_technicaltasktraining')}) + vals.append({ + 'date': time.strftime('%Y-%m-%d 16:04:00'), + 'date_deadline':time.strftime('%Y-%m-%d 20:20:00'), + }) + try: + self.check_import(cr, uid, vals, context) + except: + pass +- + Check the export Import functionality with the planned hours. +- + !python {model: project.task}: | + import time + vals = [] + context.update({'model':'project.task','active_id': ref('project_task_technicaltasktraining')}) + vals.append({ + 'date': time.strftime('%Y-%m-%d 16:04:00'), + 'create_date': time.strftime('%Y-%m-%d 16:04:00'), + 'date_deadline':time.strftime('%Y-%m-%d 20:20:00'), + 'planned_hours':30.0, + 'ids':ref('project_task_technicaltasktraining'), + 'recurrent_id': time.strftime('%Y-%m-%d 50:00:00'), + }) + try: + self.check_import(cr, uid, vals, context) + except: + pass From d854c9c5fb28a201cb9fd66b444fb3b224891f81 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Thu, 8 Sep 2011 15:07:37 +0530 Subject: [PATCH 30/36] [ADD]project_mailgate: Add the test file bzr revid: dbr@tinyerp.com-20110908093737-8sdbezrnxbfx5zxx --- addons/project_mailgate/__openerp__.py | 1 + .../test/test_project_mailgate.yml | 49 +++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 addons/project_mailgate/test/test_project_mailgate.yml diff --git a/addons/project_mailgate/__openerp__.py b/addons/project_mailgate/__openerp__.py index 4551d19bb1f..b165ca67392 100644 --- a/addons/project_mailgate/__openerp__.py +++ b/addons/project_mailgate/__openerp__.py @@ -42,6 +42,7 @@ Moreover, it keeps track of all further communications and task states. ], 'demo_xml': [ ], + 'test': ['test/test_project_mailgate.yml'], 'installable': True, 'active': False, 'certificate': '001075048780413258261', diff --git a/addons/project_mailgate/test/test_project_mailgate.yml b/addons/project_mailgate/test/test_project_mailgate.yml new file mode 100644 index 00000000000..902e38205f9 --- /dev/null +++ b/addons/project_mailgate/test/test_project_mailgate.yml @@ -0,0 +1,49 @@ +- + I create a mailgate message record. +- + !record {model: mailgate.message, id: project_mailgate_message1}: + partner_id: base.res_partner_asus +- + I create a project task. +- + !record {model: project.task, id: project_task_mailgate1}: + date_start: !eval time.strftime('%Y-%m-%d %H:%M:%S') + name: Technical Training + #message_ids: project_mailgate_message1 + user_id: base.user_root + planned_hours: 30.0 + remaining_hours: 30.0 + state: draft + +- + Keep task in draft state. +- + !python {model: project.task}: | + self.do_draft(cr, uid, [ref('project_task_mailgate1')], {'active_id':ref('project_task_mailgate1')}) +- + Keep task in open state. +- + !python {model: project.task}: | + self.do_open(cr, uid, [ref('project_task_mailgate1')], {'active_id':ref('project_task_mailgate1')}) +- + Execute the message followers. +- + !python {model: project.task}: | + self.message_followers(cr, uid, [ref('project_task_mailgate1')], {'active_id':ref('project_task_mailgate1')}) +- + Keep task in pending state. +- + !python {model: project.task}: | + self.do_pending(cr, uid, [ref('project_task_mailgate1')], {'active_id':ref('project_task_mailgate1')}) +- + Keep task in close state. +- + !python {model: project.task}: | + self.do_close(cr, uid, [ref('project_task_mailgate1')], {'active_id':ref('project_task_mailgate1')}) +- + Keep task in cancel state. +- + !python {model: project.task}: | + self.do_cancel(cr, uid, [ref('project_task_mailgate1')], {'active_id':ref('project_task_mailgate1')}) + + From 04a357179784a6a82fe74fa8f4073db0116b9437 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Wed, 14 Sep 2011 11:01:11 +0530 Subject: [PATCH 31/36] [Fix]project_timesheet : Fix the yml warning bzr revid: dbr@tinyerp.com-20110914053111-bu9h2odj50soq6u3 --- .../test/worktask_entry_to_timesheetline_entry.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/addons/project_timesheet/test/worktask_entry_to_timesheetline_entry.yml b/addons/project_timesheet/test/worktask_entry_to_timesheetline_entry.yml index bc2827ff4cc..9ba06cc57d7 100644 --- a/addons/project_timesheet/test/worktask_entry_to_timesheetline_entry.yml +++ b/addons/project_timesheet/test/worktask_entry_to_timesheetline_entry.yml @@ -134,8 +134,4 @@ - !assert {model: hr_timesheet_sheet.sheet, id: hr_timesheet_sheet_sheet_sheetforhrmanager0, string: After hr manager's work task, length of timesheet line of current timesheet must be greater then 1}: - len(timesheet_ids) > 0 -- - Unlink the task. -- - !python {model: project.task}: | - self.unlink(cr, uid, [ref("project_task_getalltimesheetrecords0")]) + From 87232b309f14f8a0fbf3314535a4a7e9615c374e Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Fri, 16 Sep 2011 17:14:03 +0530 Subject: [PATCH 32/36] [IMP]project_* : Improve the code bzr revid: dbr@tinyerp.com-20110916114403-umbfkuhovq9z9qha --- addons/project/test/test_project.yml | 26 +------- .../project/test/test_project_delegation.yml | 1 - .../test/test_project_mailgate.yml | 11 ---- .../test/project_scrum_report.yml | 64 +++++++++++-------- 4 files changed, 37 insertions(+), 65 deletions(-) diff --git a/addons/project/test/test_project.yml b/addons/project/test/test_project.yml index ff823db7063..2889b41636e 100644 --- a/addons/project/test/test_project.yml +++ b/addons/project/test/test_project.yml @@ -479,31 +479,7 @@ } self.create(cr, uid, vals, context=None) self.unlink(cr, uid, [ref('account_analytic_account0')]) -- - I close the project task. -- - !record {model: project.task.close, id: project_task_close_0}: - manager_warn : True - partner_warn : False - manager_email : 'info@mycustomer.com' - partner_email : 'info@myinfobid.com' - description : Description -- - I send Warn Message by Email to Manager and Customer. -- - !python {model: project.task.close}: | - fields = { - 'manager_warn' : True, - 'partner_warn' : False, - 'manager_email' : 'info@mycustomer.com', - 'partner_email' : 'info@myinfobid.com', - 'description' : 'Description' - } - self.default_get(cr, uid, fields, context={"active_ids":[ref("project_task_technicaltraining0")],"active_id": ref("project_task_technicaltraining0")}) - try: - self.send(cr, uid, [ref('project_task_close_0')], context={"active_ids":[ref("project_task_technicaltraining0")],"active_id": ref("project_task_technicaltraining0")}) - except : - pass + - I check for remaining hours. - diff --git a/addons/project/test/test_project_delegation.yml b/addons/project/test/test_project_delegation.yml index 2aabb0a4766..68cf5f7e0fd 100644 --- a/addons/project/test/test_project_delegation.yml +++ b/addons/project/test/test_project_delegation.yml @@ -236,4 +236,3 @@ - !assert {model: project.task, id: project_task_documentation_book, severity: error, string: Task is in done state}: - state == "open" -- diff --git a/addons/project_mailgate/test/test_project_mailgate.yml b/addons/project_mailgate/test/test_project_mailgate.yml index 902e38205f9..2ae6119698f 100644 --- a/addons/project_mailgate/test/test_project_mailgate.yml +++ b/addons/project_mailgate/test/test_project_mailgate.yml @@ -1,15 +1,9 @@ -- - I create a mailgate message record. -- - !record {model: mailgate.message, id: project_mailgate_message1}: - partner_id: base.res_partner_asus - I create a project task. - !record {model: project.task, id: project_task_mailgate1}: date_start: !eval time.strftime('%Y-%m-%d %H:%M:%S') name: Technical Training - #message_ids: project_mailgate_message1 user_id: base.user_root planned_hours: 30.0 remaining_hours: 30.0 @@ -25,11 +19,6 @@ - !python {model: project.task}: | self.do_open(cr, uid, [ref('project_task_mailgate1')], {'active_id':ref('project_task_mailgate1')}) -- - Execute the message followers. -- - !python {model: project.task}: | - self.message_followers(cr, uid, [ref('project_task_mailgate1')], {'active_id':ref('project_task_mailgate1')}) - Keep task in pending state. - diff --git a/addons/project_scrum/test/project_scrum_report.yml b/addons/project_scrum/test/project_scrum_report.yml index e4bd785e542..c54ed0134ad 100644 --- a/addons/project_scrum/test/project_scrum_report.yml +++ b/addons/project_scrum/test/project_scrum_report.yml @@ -11,6 +11,12 @@ !record {model: project.project, id: project_project_0}: company_id: base.main_company name: OpenERP Training Test +- + I create project 'Functional Programme'. +- + !record {model: project.project, id: project_project_1}: + company_id: base.main_company + name: Functional Test - In order to test the PDF reports defined on a Project Scrum, we will print Project Scrum Sprint Burndown Report. - @@ -21,7 +27,7 @@ if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'project_scrum-project_scrum_sprint_burndown.'+format), 'wb+').write(data) - - I create a project.scrum.product.backlog record. + I create a project scrum product backlog record. - !record {model: project.scrum.product.backlog, id: project_scrum_product_backlog0}: effective_hours: 0.0 @@ -30,6 +36,28 @@ project_id: project_project_0 sequence: 0.0 state: draft +- + Now, I create another two project scrum product backlog record for the merging purpose. +- + I create "Test_merge_bklg1" project scrum product backlog record. +- + !record {model: project.scrum.product.backlog, id: project_scrum_product_backlog1}: + effective_hours: 0.0 + expected_hours: 0.0 + name: test_merge_bklg1 + project_id: project_project_0 + sequence: 0.0 + state: draft +- + I create "Test_merge_bklg2" project scrum product backlog record. +- + !record {model: project.scrum.product.backlog, id: project_scrum_product_backlog2}: + effective_hours: 0.0 + expected_hours: 0.0 + name: test_merge_bklg2 + project_id: project_project_1 + sequence: 0.0 + state: draft - In order to test the Product Backlog. - @@ -66,26 +94,6 @@ self.button_send_product_owner(cr, uid, [ref("project_scrum_meeting_0")],context=None) except: pass -- - I create a project.scrum.email record. -- - !record {model: project.scrum.email, id: project_scrum_email_0}: - subject: Subject - message: test message -- - Send project scrum email. -- - !python {model: project.scrum.email}: | - fields={ - 'subject': 'Subject', - 'message': 'test message' - } - context.update({'active_ids':[ref('project_scrum_meeting_0')],'active_id':ref('project_scrum_meeting_0')}) - self.default_get(cr, uid, fields, context) - try: - self.button_send_scrum_email(cr, uid, [ref("project_scrum_email_0")],context) - except: - pass - I create first scrum backlog for merge the record. - @@ -95,17 +103,17 @@ I create second scrum backlog for merge the record. - !record {model: project.scrum.backlog.merge, id: project_scrum_backlog_merge2}: - project_id: project_project_0 + project_id: project_project_1 - Set project scrum backlog merge. - !python {model: project.scrum.backlog.merge}: | - context['active_ids'] = [ref("project_scrum_backlog_merge1"),ref("project_scrum_backlog_merge2")] - context['active_id'] = [ref("project_scrum_backlog_merge1")] - try: - self.check_backlogs(cr, uid, [ref("project_scrum_backlog_merge2")],context) - except: - pass + context.update({ + 'active_model': 'project.scrum.product.backlog', + 'active_ids': [ref("project_scrum_product_backlog1"),ref("project_scrum_product_backlog2")], + 'active_id': ref("project_scrum_product_backlog1")}) + self.check_backlogs(cr, uid, [ref("project_scrum_product_backlog1"),ref("project_scrum_product_backlog2")],context) + self.do_merge(cr, uid, [ref('project_scrum_backlog_merge1'),ref('project_scrum_backlog_merge2')], context) - In order to test the project_scrum_backlog_create_task wizard. - From e8dd71569d39ca55cfcc4e610eaf3077058cc44e Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Wed, 21 Sep 2011 14:47:00 +0530 Subject: [PATCH 33/36] [Fix]project_issue: Remove the conflicts bzr revid: dbr@tinyerp.com-20110921091700-xsbjwhnv074zf008 --- addons/project/test/test_project.yml | 3 +-- .../test/convert_issue_to_task.yml | 26 +++++++++---------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/addons/project/test/test_project.yml b/addons/project/test/test_project.yml index 2889b41636e..5cca325f0ab 100644 --- a/addons/project/test/test_project.yml +++ b/addons/project/test/test_project.yml @@ -66,8 +66,7 @@ !python {model: project.task}: | context.update({'project_id': ref('project_task_functionaltraining0')}) self._default_project(cr, uid,context) - self.fields_view_get(cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False) - self.action_close + #self.fields_view_get(cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False) - I click on Draft button. - diff --git a/addons/project_issue/test/convert_issue_to_task.yml b/addons/project_issue/test/convert_issue_to_task.yml index 2d6d96359d8..d6d0fe10fb3 100644 --- a/addons/project_issue/test/convert_issue_to_task.yml +++ b/addons/project_issue/test/convert_issue_to_task.yml @@ -1,3 +1,8 @@ +- + I create project 'OpenERP Training Programme'. +- + !record {model: project.project, id: project_issue_0}: + name: project issue training programme - I create task 'Training' for this project. - @@ -6,9 +11,9 @@ name: Technical Training user_id: base.user_root planned_hours: 30.0 - project_id: project.project_project_22 remaining_hours: 30.0 state: draft + project_id: project_issue_0 - I create a project issue. - @@ -16,7 +21,7 @@ categ_id: project_issue.bug_categ date_open: !eval time.strftime('%Y-%m-%d') name: on_change event does not pass context to the method - project_id: project.project_project_22 + project_id: project_issue_0 task_id: project_task_training0 working_hours_close: 0.0 working_hours_open: 0.0 @@ -35,7 +40,7 @@ 'categ_id': ref('project_issue.bug_categ'), 'date_open': time.strftime('%Y-%m-%d'), 'name': 'on_change event does not pass context to the method', - 'project_id': ref('project.project_project_22'), + 'project_id': ref('project_issue_0'), 'task_id': ref('project_task_training0'), 'working_hours_close': 0.0, 'working_hours_open': 0.0, @@ -66,7 +71,7 @@ Get project issue's task work. - !python {model: project.issue}: | - context.update({'project_id':ref('project.project_project_22')}) + context.update({'project_id':ref('project_issue_0')}) self._get_project(cr, uid, context) - I creat some changes on project. @@ -111,7 +116,7 @@ !python {model: project.issue}: | msg = { 'subject': 'test_email', - 'body': 'Testing Project Issue', + 'body_text': 'Testing Project Issue', 'from': 'Administrator ', } self.message_new(cr, uid,msg,context) @@ -119,17 +124,12 @@ I update this messages. - !python {model: project.issue}: | - vals = {} msg = { 'subject': 'test_email', - 'body': 'Testing Project Issue', + 'body_text': 'Testing Project Issue', 'from': 'Administrator ', } context = None default_act = 'pending' - self.message_update(cr, uid, [ref('project_issue_onchangeevent0')], vals, msg, default_act, context) -- - I send created and update the messages. -- - !python {model: project.issue}: | - self.msg_send(cr, uid, [ref('project_issue_onchangeevent0')]) + self.message_update(cr, uid, [ref('project_issue_onchangeevent0')], msg,context) + From 17b98e058ccbf725d5fd7a1498b41831d9a86eb7 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Fri, 23 Sep 2011 14:18:55 +0530 Subject: [PATCH 34/36] [IMP]Improve the code bzr revid: dbr@tinyerp.com-20110923084855-j87vzna3gv39h6hm --- addons/project/test/test_project.yml | 30 +++++++++---------- .../project/test/test_project_delegation.yml | 4 +-- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/addons/project/test/test_project.yml b/addons/project/test/test_project.yml index 5cca325f0ab..c58dc2bb729 100644 --- a/addons/project/test/test_project.yml +++ b/addons/project/test/test_project.yml @@ -1,8 +1,3 @@ -- - I assign an email address to Administrator. -- - !record {model: res.users, id: base.user_root}: - user_email: admin@openerp.com - I test project template feature. - @@ -12,11 +7,10 @@ company_id: base.main_company name: OpenERP Training Programm - - I create analytic account. + I assign an email address to Administrator for communications. - - !record {model: account.analytic.account, id: account_analytic_account0}: - name : account_analytic_account - partner_id: base.res_partner_asus + !record {model: res.users, id: base.user_root}: + user_email: admin@openerp.com - I create project 'OpenERP Training Programme'. - @@ -28,7 +22,13 @@ 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 analytic account for assigned partner in project. +- + !record {model: account.analytic.account, id: account_analytic_account0}: + name : account_analytic_account + partner_id: base.res_partner_asus +- + I create task 'Technical Training' for 'OpenERP Training Programme' 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 'OpenERP Training Programme' 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 'OpenERP Training Programme' project. - !record {model: project.task, id: project_task_functionaltraining0}: date_start: !eval time.strftime('%Y-%m-%d %H:%M:%S') @@ -88,7 +88,7 @@ !python {model: project.task}: | self.do_open(cr, uid,[ref("project_task_functionaltraining0")],context={}) - - I check child project. + I check is there any child task assigned to 'Functional Training' task. - !python {model: project.task}: | self._check_child_task(cr, uid, [ref("project_task_functionaltraining0")]) @@ -108,12 +108,12 @@ !python {model: project.task}: | self._change_type(cr, uid,[ref("project_task_functionaltraining0")], next, context) - - I click on next Button for change the type of project task. + I click on next button for change the type of project task. - !python {model: project.task}: | self.next_type(cr, uid,[ref("project_task_functionaltraining0")], context) - - I click on previous Button for go back to previous type of task. + I click on previous button for go back to previous type of task. - !python {model: project.task}: | self.prev_type(cr, uid,[ref("project_task_functionaltraining0")], context) diff --git a/addons/project/test/test_project_delegation.yml b/addons/project/test/test_project_delegation.yml index 68cf5f7e0fd..682ef8ce75a 100644 --- a/addons/project/test/test_project_delegation.yml +++ b/addons/project/test/test_project_delegation.yml @@ -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. + I 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: @@ -148,7 +148,7 @@ state: draft - - Now, delegate task 'Prepare a technical reference for creating your modules' to these tasks and make it pending. + I 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: From 1d715a371fc7b94e70a79443263834b47059d9f0 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Fri, 23 Sep 2011 14:27:04 +0530 Subject: [PATCH 35/36] Set parent_id for project in right place bzr revid: dbr@tinyerp.com-20110923085704-872zdzhtgxsojet3 --- addons/project/test/test_project.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/project/test/test_project.yml b/addons/project/test/test_project.yml index c58dc2bb729..21d55b49d37 100644 --- a/addons/project/test/test_project.yml +++ b/addons/project/test/test_project.yml @@ -11,6 +11,12 @@ - !record {model: res.users, id: base.user_root}: user_email: admin@openerp.com +- + I create analytic account for assigned partner in project. +- + !record {model: account.analytic.account, id: account_analytic_account0}: + name : account_analytic_account + partner_id: base.res_partner_asus - I create project 'OpenERP Training Programme'. - @@ -21,12 +27,6 @@ name: OpenERP Training Programme date_start: !eval time.strftime('%Y-%m-%d') date: !eval time.strftime('%Y-%m-%d') -- - I create analytic account for assigned partner in project. -- - !record {model: account.analytic.account, id: account_analytic_account0}: - name : account_analytic_account - partner_id: base.res_partner_asus - I create task 'Technical Training' for 'OpenERP Training Programme' project. - From f93536a356d5633a363105ed973a48990f7e8f86 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Fri, 23 Sep 2011 15:08:20 +0530 Subject: [PATCH 36/36] [RMV]project_caldav: remove test file bzr revid: dbr@tinyerp.com-20110923093820-3xfn39ju1dhq3w0c --- addons/project/test/test_project.yml | 10 ++-- addons/project_caldav/__openerp__.py | 1 - .../test/test_project_caldav.yml | 59 ------------------- 3 files changed, 5 insertions(+), 65 deletions(-) delete mode 100644 addons/project_caldav/test/test_project_caldav.yml diff --git a/addons/project/test/test_project.yml b/addons/project/test/test_project.yml index 21d55b49d37..970f5d4f5a1 100644 --- a/addons/project/test/test_project.yml +++ b/addons/project/test/test_project.yml @@ -39,7 +39,7 @@ remaining_hours: 30.0 state: draft - - I create task 'Training' for 'OpenERP Training Programme' project. + I create child task 'Training' of 'OpenERP Training Programme' project. - !record {model: project.task, id: project_task_child0}: date_start: !eval time.strftime('%Y-%m-%d %H:%M:%S') @@ -154,7 +154,7 @@ !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 'OpenERP Training Programme' project as project template. - !python {model: project.project}: | self.set_template(cr, uid, [ref("project_project_openerptrainingprogramme0")], @@ -180,7 +180,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 'OpenERP Training Programme'. - !python {model: project.project}: | self.reset_project(cr, uid, [ref("project_project_openerptrainingprogramme0")], {"lang": "en_US", "active_ids": @@ -209,7 +209,7 @@ - state == "pending" - I cancel the project. -- +- !python {model: project.project}: | self.set_cancel(cr, uid, [ref("project_project_openerptrainingprogramme0")], {"lang": "en_US", "active_ids": [ref("project.menu_open_view_project_all")], "tz": False, "active_model": @@ -255,7 +255,7 @@ !python {model: project.task.reevaluate}: | self._get_remaining(cr, uid,{'active_id':ref('project_task_functionaltraining0') }) - | - I click the apply button. + I click the apply button for compute hours. - !python {model: project.task.reevaluate}: | self.compute_hours(cr, uid, [ref('project_task_technicaltraining_remainingwiz0')], {'active_id': ref("project_task_technicaltraining0"),'button_reactivate': True}) diff --git a/addons/project_caldav/__openerp__.py b/addons/project_caldav/__openerp__.py index 838914ba9e6..29c9ec4d483 100644 --- a/addons/project_caldav/__openerp__.py +++ b/addons/project_caldav/__openerp__.py @@ -34,7 +34,6 @@ on a remote server. "depends": ["project", "caldav", "base_calendar"], "init_xml": ["project_caldav_data.xml", 'project_caldav_setup.xml', ], "demo_xml": [], - "test": ['test/test_project_caldav.yml'], "update_xml": ["project_caldav_view.xml"], "active": False, "website": "http://www.openerp.com", diff --git a/addons/project_caldav/test/test_project_caldav.yml b/addons/project_caldav/test/test_project_caldav.yml deleted file mode 100644 index 3ed1e6f38ec..00000000000 --- a/addons/project_caldav/test/test_project_caldav.yml +++ /dev/null @@ -1,59 +0,0 @@ -- | - Now Create test cases for project caldav -- - I create task 'Training task' for this project. -- - !record {model: project.task, id: project_task_technicaltasktraining}: - date_start: !eval time.strftime('%Y-%m-%d %H:%M:%S') - name: Technical Training - user_id: base.user_root - planned_hours: 30.0 - date_deadline: !eval time.strftime('%Y-%m-%d 20:20:00') - remaining_hours: 30.0 - state: draft -- - Open the created task. -- - !python {model: project.task}: | - context.update({'model':'project.task','active_id': ref('project_task_technicaltasktraining')}) - self.open_task(cr, uid, [ref('project_task_technicaltasktraining')], context) -- - Check the export functionality. -- - !python {model: project.task}: | - context.update({'model':'project.task','active_id': ref('project_task_technicaltasktraining')}) - self.export_cal(cr, uid, [ref('project_task_technicaltasktraining')], context) -- - Check the Import functionality with the define date. -- - !python {model: project.task}: | - import time - vals = [] - context.update({'model':'project.task','active_id': ref('project_task_technicaltasktraining')}) - vals.append({ - 'date': time.strftime('%Y-%m-%d 16:04:00'), - 'date_deadline':time.strftime('%Y-%m-%d 20:20:00'), - }) - try: - self.check_import(cr, uid, vals, context) - except: - pass -- - Check the export Import functionality with the planned hours. -- - !python {model: project.task}: | - import time - vals = [] - context.update({'model':'project.task','active_id': ref('project_task_technicaltasktraining')}) - vals.append({ - 'date': time.strftime('%Y-%m-%d 16:04:00'), - 'create_date': time.strftime('%Y-%m-%d 16:04:00'), - 'date_deadline':time.strftime('%Y-%m-%d 20:20:00'), - 'planned_hours':30.0, - 'ids':ref('project_task_technicaltasktraining'), - 'recurrent_id': time.strftime('%Y-%m-%d 50:00:00'), - }) - try: - self.check_import(cr, uid, vals, context) - except: - pass