-
- 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'
-
!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
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)
+-
+ 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.
+-
+ !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 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.
+-
+ !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
-
!python {model: project.project}: |
"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"
!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})
- 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
-
!record {model: project.task.reevaluate, id: config_compute_remaining_0}:
-
!assert {model: project.task, id: project_task_technicaltraining0, severity: error, string: Task is in done state}:
- state == "done"
-
-
-
Test for task reactivation
-
- 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
-
!python {model: project.task}: |
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
-
!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")})
+-
+ 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")})
+-
+ 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")])
-
- 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
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
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
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"
+-
--
+-
+ 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
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",
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",
+ 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'.
+-
+ !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
-
"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")
+
-
- 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")],
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 <admin@openerp.com>',
+ }
+ 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 <admin@openerp.com>',
+ }
+ 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')])
-
- 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
-
!assert {model: project.issue, id: project_issue_stockmovedates0, severity: error, string: Issue is in draft state}:
- state == 'draft'
-
-
Open the issue
-
-
!assert {model: project.issue, id: project_issue_stockmovedates0, severity: error, string: Issue is in open state}:
- state == 'open'
-
-
Keep issue pending
-
1, "project_id": False, "active_id": ref("project_issue.menu_project_issue_track"),
})
-
- Check if issue in 'pending' 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
-
!assert {model: project.issue, id: project_issue_stockmovedates0, severity: error, string: Issue is in pending state}:
- state == 'pending'
-
-
-
Open the issue
-
-
!assert {model: project.issue, id: project_issue_stockmovedates0, severity: error, string: Issue is in open state}:
- state == 'open'
-
-
-
Cancel the issue
-
-
!assert {model: project.issue, id: project_issue_stockmovedates0, severity: error, string: Issue is in cancel state}:
- state == 'cancel'
-
-
-
Reset the issue
-
-
!assert {model: project.issue, id: project_issue_stockmovedates0, severity: error, string: Issue is in draft state}:
- state == 'draft'
-
-
-
Close the issue
-
-
!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)
-
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'
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")])
+
+
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)
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
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
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)
-
- Open the planning
+ Open the 'Project Planning'
-
!python {model: report_account_analytic.planning}: |
self.action_open(cr, uid, [ref("report_account_analytic_planning_projectplanning0")],
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")],
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")],
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")],
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")],
"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"
company_id: base.main_company
date: !eval time.strftime('%Y-%m-%d')
name: Retro Planning
-
-
Create task 'Plan all projects'
-
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)
"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',
-
+ 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.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.
+-
+ !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)
+-
+ 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
--- /dev/null
+-
+ 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")])
!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'
"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
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")])