-
- I test project template feature.
+ Test project template feature
-
- I create test project 'OpenERP Test Programme'.
--
- !record {model: project.project, id: project_project_testprogramme0}:
- company_id: base.main_company
- name: OpenERP Training Programm
--
- I assign an email address to Administrator for communications.
--
- !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'.
+ 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')
- date: !eval time.strftime('%Y-%m-%d')
-
- I create task 'Technical Training' for 'OpenERP Training Programme' project.
+ 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')
name: Technical Training
- user_id: base.user_root
planned_hours: 30.0
project_id: project_project_openerptrainingprogramme0
remaining_hours: 30.0
state: draft
-
- 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')
- name: Training
- planned_hours: 30.0
- project_id: project_project_openerptrainingprogramme0
- remaining_hours: 30.0
- state: done
--
- I create task 'Functional Training' for 'OpenERP Training Programme' project.
+ 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')
planned_hours: 30.0
project_id: project_project_openerptrainingprogramme0
remaining_hours: 30.0
- child_ids:
- - project_task_child0
state: draft
-
- I 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)
--
- I click on Draft button.
--
- !python {model: project.task}: |
- self.do_draft(cr, uid, [ref("project_task_functionaltraining0")], context={})
--
- I click on Start task button.
--
- !python {model: project.task}: |
- self.do_open(cr, uid,[ref("project_task_functionaltraining0")],context={})
--
- I click Pending button.
--
- !python {model: project.task}: |
- self.do_pending(cr, uid, [ref("project_task_functionaltraining0")], context={})
--
- I click on Start task button.
--
- !python {model: project.task}: |
- self.do_open(cr, uid,[ref("project_task_functionaltraining0")],context={})
--
- 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")])
--
- I do some changes on project without define partner.
--
- !python {model: project.task}: |
- self.onchange_project(cr, uid, [ref("project_task_functionaltraining0")],[])
--
- I do some changes on project.
--
- !python {model: project.task}: |
- self.onchange_project(cr, uid, [ref("project_task_functionaltraining0")],ref('project_project_openerptrainingprogramme0'))
--
- I change the type of project.
--
- !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.
--
- !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.
--
- !python {model: project.task}: |
- self.prev_type(cr, uid,[ref("project_task_functionaltraining0")], context)
--
- 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
--
- I create project's Work.
--
- !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")})
--
- I add project's Work.
--
- !python {model: project.task.work}: |
- 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")})
--
- 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")})
--
- 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")})
--
- I set 'OpenERP Training Programme' project as project template.
+ 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.
+ 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.
+ Create new project based on this template
-
!python {model: project.project}: |
new_prj = self.duplicate_template(cr, uid, [ref("project_project_openerptrainingprogramme0")],
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 'OpenERP Training Programme'.
+ Reset project template to normal project
-
!python {model: project.project}: |
self.reset_project(cr, uid, [ref("project_project_openerptrainingprogramme0")], {"lang": "en_US", "active_ids":
"ir.ui.menu", "project_id": False, "active_id": ref("project.menu_open_view_project_all"),
})
-
- I check if project in open state.
+ 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.
+ 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":
"ir.ui.menu", "project_id": False, "active_id": ref("project.menu_open_view_project_all"),
})
-
- I check if project in pending state.
+ 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.
--
+ 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":
"ir.ui.menu", "project_id": False, "active_id": ref("project.menu_open_view_project_all"),
})
-
- I check if project in cancel state.
+ 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.
+ 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.
+ 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
- |
- 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)
-- |
- Now get the remaining hours required to close the task.
--
- !python {model: project.task.reevaluate}: |
- self._get_remaining(cr, uid,{'active_id':ref('project_task_functionaltraining0') })
-- |
- I click the apply button for compute hours.
+ 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})
- |
- I check if task 'Technical Training' in open state and for other initial values.
+ 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"
- delay_hours == 0.0
- effective_hours == 0.0
-
- I create a work task entry 'Training on OpenERP modules, models and classes' of 10 hours.
+ Make 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:
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.
+ 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.
+ Make 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:
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.
+ 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.
+ Make 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:
name: Training on workflows
user_id: base.user_root
-
- I check for effective hours and remaining hours, effective_hours must be equal to 30.
+ 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.
+ 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.
+ Reevaluate the task
-
!python {model: project.task.reevaluate}: |
self.compute_hours(cr, uid, [ref("config_compute_remaining_0")], {"lang": "en_US",
[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.
+ 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.
+ Make 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:
name: Training on reports and wizards
user_id: base.user_root
-
- I check for effective hours and remaining hours.
+ 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.
+ 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.
+ 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.
+ Test for task reactivation
-
- I reactivate task.
+ 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",
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.
+ 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.
+ Make 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:
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.
+ 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.
--
- !python {model: project.task}: |
- self.onchange_remaining(cr, uid, [ref("project_task_functionaltraining0")], remaining = 10.0, planned = False)
--
- I close the task.
+ 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.
+ 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.
+ 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.
+ Close project 'OpenERP Training Programme'
-
!python {model: project.project}: |
- context.update({"lang": "en_US", "active_ids": [ref("project.menu_open_view_project_all")],
+ 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")})
- user = ref('base.user_demo')
- try:
- self.search(cr, user, args={}, offset=0, limit=None, order=None, context=None, count=False)
- except:
- pass
--
- 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'.
--
- !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')
- 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)
-
+ ref("project.menu_open_view_project_all"), })
-
- I check if project in close state.
+ 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"
--
- Now, 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}: |
- 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')])
--
- I check for remaining hours.
--
- !python {model: project.task}: |
- self.onchange_remaining(cr, uid, [ref("project_task_functionaltraining0")], remaining = 0.0, planned = 0.0)
--
- I change the planned.
--
- !python {model: project.task}: |
- self.onchange_planned(cr, uid, [ref("project_task_functionaltraining0")], planned = 0.0, effective = 0.0)
--
- 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)
--
- Now, unlink this project's task.
--
- !python {model: project.task}: |
- self.unlink(cr, uid,[ref("project_task_functionaltraining0")])
--
- Now, unlink the project.
--
- !python {model: project.project}: |
- self.unlink(cr, uid, [ref('project_project_testprogramme0')])
-
- 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 create a project OpenERP Documentation.
--
+ 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
-
--
- I create a task 'Develop book for Technical and Functional reference'.
--
+ 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: pending
--
- I open the 'Develop book for Technical and Functional reference' task.
--
+ state: draft
+
+-
+ Open the task
+-
!python {model: project.task}: |
self.do_open(cr, uid, [ref("project_task_documentation_book")],
{"lang": "en_US", "active_model": "ir.ui.menu", "active_ids": [ref("project.menu_action_view_task")],
- "tz": False, "active_id": ref("project.menu_action_view_task"), })
--
- I create a task 'Publish the References'.
--
+ "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
-
--
- I open the task 'Publish the References'.
--
+
+-
+ Open the task
+-
!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"), })
-
- I test the delegate wizard.
--
- I create a delegate task 'Publish the References' of 15 hours, renaming parent task to 'CHECK Publish the References' of 1 hour.
--
+ 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: test_new_task
+ new_task_description: aaa
planned_hours: 15.0
planned_hours_me: 1.0
prefix: 'CHECK: Publish the References'
state: pending
user_id: base.user_demo
--
- I create view for delegate task.
--
+
+-
+ Validating the delegate task
+-
!python {model: project.task.delegate}: |
- 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)
--
- 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.
+ 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"),
+ })
+
-
+ 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 create 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
-
--
- I open the delegate task 'Prepare a book that gives functional overview of OpenERP'.
--
+
+-
+ Open the task
+-
!python {model: project.task}: |
self.do_open(cr, uid, [ref("project_task_delegate_openerp_tutorial")],
{"lang": "en_US", "active_model": "ir.ui.menu", "active_ids": [ref("project.menu_action_view_task")],
"tz": False, "active_id": ref("project.menu_action_view_task"), })
-
--
- I create a delegate task 'Prepare a technical reference for creating your modules'.
--
+
+-
+ 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
-
--
- I open the delegate task 'Prepare a technical reference for creating your modules'.
--
+
+-
+ Open the task
+-
!python {model: project.task}: |
self.do_open(cr, uid, [ref("project_task_delegate_developer_book")],
{"lang": "en_US", "active_model": "ir.ui.menu", "active_ids": [ref("project.menu_action_view_task")],
"tz": False, "active_id": ref("project.menu_action_view_task"), })
--
- I delegate task 'Develop book for Technical and Functional reference' to these tasks and make it pending.
--
+-
+ 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
--
- I create a delegate task 'Prepare documentation for Module Development'.
--
+-
+ 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
+
-
--
- I create a delegate 'Prepare documentation for Business Process Development'.
--
+-
+ 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
--
- I delegate task 'Prepare a technical reference for creating your modules' to these tasks and make it pending.
--
+-
+ 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
--
- I open the task 'Prepare documentation for Business Process Development'.
--
+-
+ Open the task
+-
!python {model: project.task}: |
self.do_open(cr, uid, [ref("project_task_delegate_module_develop")],
{"lang": "en_US", "active_model": "ir.ui.menu", "active_ids": [ref("project.menu_action_view_task")],
"tz": False, "active_id": ref("project.menu_action_view_task"), })
-
--
- I open the task 'Prepare documentation for Business Process Development'.
--
+
+-
+ Open the task
+-
!python {model: project.task}: |
self.do_open(cr, uid, [ref("project_task_delegate_business_process_develop")],
{"lang": "en_US", "active_model": "ir.ui.menu", "active_ids": [ref("project.menu_action_view_task")],
- "tz": False, "active_id": ref("project.menu_action_view_task"), })
--
- I check if 'Prepare a technical reference for creating your modules' in pending state.
--
+ "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"
-
--
- I close the child task 'Prepare documentation for Module Development'.
--
+
+-
+ 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"),
})
-
--
- I close the child task 'Prepare documentation for Business Process Development'.
--
+
+-
+ 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.
--
+
+-
+ 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.
--
+
+
+-
+ 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'.
--
+
+-
+ 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"),
})
-
--
- I 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"
--
- I create a task 'Develop time management module' with monthly timebox.
--
+-
+ 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
--
- I 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.
--
- !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)
--
- I change the time to next.
--
- !python {model: project.task}: |
- self.next_timebox(cr, uid, [ref("project_task_developtimemanagementmodule0")])
--
- 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":
"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"),
})
--
- I create time box for next week.
--
+
+-
+ Create time box for next week
+-
!record {model: project.gtd.timebox, id: project_gtd_timebox_nextweek0}:
name: Next Week
sequence: 0.0
--
- I create time box for tomorrow.
--
+
+-
+ 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:
- project_task_developtimemanagementmodule0
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)
- 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"),
})
+
-
- I check if task set to tomorrow timebox.
+ 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)
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":
[ref("project_gtd_timebox_tomorrow1")], "active_id": ref("project_gtd_timebox_tomorrow1"),
})
+
-
- I check task 'Develop time management module' is no more in tomorrow timebox.
+ 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")
+ !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
-
- 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.
--
- !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
- remaining_hours: 30.0
- state: draft
- project_id: project_issue_0
--
- I create a project issue.
+ Create an 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_issue_0
- task_id: project_task_training0
+ project_id: project.project_project_22
working_hours_close: 0.0
working_hours_open: 0.0
+
-
- I check there is no task attached to project issue.
+ Check there is no task attached to issue
-
!assert {model: project.issue, id: project_issue_onchangeevent0, string: There must not be any task attached to issue}:
- task_id.id == False
+
-
- I 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_issue_0'),
- '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)
--
- I convert project issue to task.
+ Convert 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":
ref("project_issue.menu_project_issue_track"), })
-
- I check there is a task attached to project issue.
+ Check there is a task attached to 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}: |
- context.update({'project_id':ref('project_issue_0')})
- self._get_project(cr, uid, context)
--
- I creat some changes on project.
--
- !python {model: project.issue}: |
- self.on_change_project(cr, uid, [ref("project_issue_onchangeevent0")],context)
--
- Now, go to next issue.
--
- !python {model: project.issue}: |
- self.next_type(cr, uid, [ref("project_issue_onchangeevent0")])
--
- Now, go to Previous issue.
--
- !python {model: project.issue}: |
- self.prev_type(cr, uid, [ref("project_issue_onchangeevent0")])
--
- I check the task.
--
- !python {model: project.issue}: |
- self.onchange_task_id(cr, uid, [ref("project_issue_onchangeevent0")], ref('project_task_training0'),context=None)
--
- I convert Issue to Feature.
--
- !python {model: project.issue}: |
- self.convert_to_feature(cr, uid, [ref("project_issue_onchangeevent0")])
--
- I convert Issue to Bug.
--
- !python {model: project.issue}: |
- self.convert_to_bug(cr, uid, [ref("project_issue_onchangeevent0")])
--
- I copy the issue.
--
- !python {model: project.issue}: |
- default=None
- context=None
- self.copy(cr, uid, ref("project_issue_onchangeevent0"),default, context)
--
- I create Message.
--
- !python {model: project.issue}: |
- msg = {
- 'subject': 'test_email',
- 'body_text': 'Testing Project Issue',
- 'from': 'Administrator <admin@openerp.com>',
- }
- self.message_new(cr, uid,msg,context)
--
- I update this messages.
--
- !python {model: project.issue}: |
- msg = {
- 'subject': 'test_email',
- 'body_text': 'Testing Project Issue',
- 'from': 'Administrator <admin@openerp.com>',
- }
- context = None
- default_act = 'pending'
- self.message_update(cr, uid, [ref('project_issue_onchangeevent0')], msg,context)
-
-
- I assign an Escalation project as "Study + Prototype".
--
- !record {model: project.project, id: project.project_project_22}:
- project_escalation_id: project.project_project_21
--
- I check escalate the project assign.
--
- !python {model: project.project}: |
- self._check_escalation(cr, uid, [ref('project.project_project_22')], context=None)
--
- I create an issue for "Specific Developments" project.
+ Create an issue
-
!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
--
- I check if issue in 'draft' state.
+-
+ Check if issue in 'draft' state
-
!assert {model: project.issue, id: project_issue_stockmovedates0, severity: error, string: Issue is in draft state}:
- state == 'draft'
--
- I open the issue.
--
+
+-
+ 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"), })
--
- I check if issue in 'open' state.
+-
+ 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")],
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.
--
- !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"),
- })
--
- I check if issue in 'Escalate' state.
+-
+ Check if issue in 'pending' state
-
!assert {model: project.issue, id: project_issue_stockmovedates0, severity: error, string: Issue is in pending state}:
- state == 'pending'
--
- I open the issue.
--
+
+
+-
+ 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"), })
--
- I check if issue in 'open' state.
+-
+ Check if issue in 'open' state
-
!assert {model: project.issue, id: project_issue_stockmovedates0, severity: error, string: Issue is in open state}:
- state == 'open'
--
- I cancel the issue.
--
+
+
+-
+ 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")],
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"),
})
--
- I check if issue in 'cancel' state.
+-
+ Check if issue in 'cancel' state
-
!assert {model: project.issue, id: project_issue_stockmovedates0, severity: error, string: Issue is in cancel state}:
- state == 'cancel'
--
- Now, reset the issue.
--
+
+
+-
+ 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")],
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"),
})
--
- I check if issue in 'draft' state.
+-
+ Check if issue in 'draft' state
-
!assert {model: project.issue, id: project_issue_stockmovedates0, severity: error, string: Issue is in draft state}:
- state == 'draft'
--
- I close the issue.
--
+
+
+-
+ 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")],
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"),
})
--
- I check if issue in 'done' state.
+-
+ Check if issue in 'done' state
-
!assert {model: project.issue, id: project_issue_stockmovedates0, severity: error, string: Issue is in done state}:
- state == 'done'
],
'demo_xml': [
],
- 'test': ['test/test_project_issue_sheet.yml'],
'installable': True,
'active': False,
'certificate' : '00856032058128997037',
+++ /dev/null
--
- 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)
--
- I have a project 'Develop yaml Project Module'.
--
+-
+ Given that I have a project 'Test Phases'.
+-
!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
- hour_to : 17.00
- 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"
- 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
- hour_to : 17.00
- 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"
- calendar_id : resource_calendar_hoursweeks0
-
-
--
- Now Set working period to Project 'Develop yaml Project Module'.
--
- !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)
--
- I create 3 consecutive 5-days phases.
- For that Creating a Analyst Human resource to analyst Project Yaml.
--
+ resource_calendar_id: resource.timesheet_group1
+-
+ And I create three human ressources to work on this project, an analyst.
+-
!record {model: resource.resource, id: resource_resource_analyst1}:
- calendar_id: project_long_term.resource_calendar_hoursweeks0
+ calendar_id: resource.timesheet_group1
name: Analyst
resource_type: user
time_efficiency: 1.0
user_id: base.user_admin
-
--
- I create Developer Human resource who develop Yaml.
--
+-
+ I define a developer HR.
+-
!record {model: resource.resource, id: resource_resource_develop0}:
- calendar_id: project_long_term.resource_calendar_hoursweeks0
+ calendar_id: resource.timesheet_group1
name: Developer
resource_type: user
time_efficiency: 1.0
user_id: base.user_admin
--
- I create a Tester Human resource for testing Yaml.
--
+-
+ I define a tester HR.
+-
!record {model: resource.resource, id: resource_resource_tester1}:
- calendar_id: project_long_term.resource_calendar_hoursweeks0
+ calendar_id: resource.timesheet_group1
name: tester
resource_type: user
time_efficiency: 1.0
user_id: base.user_admin
-
--
- I create 3 a project phase and NO one depends on other one.
- so,they should start on the same day.
- I create First 'Analysis Flow for Yaml' Project Phase.
--
+-
+ Then I create three phases for my projects; Analysis, Development, Testing.
+-
+ The first phase is 'Analysis' and has a duration of 6 days.
+-
!record {model: project.phase, id: project_phase_analysisflowforyaml0}:
date_start: !eval time.strftime('%Y-%m-%d')
duration: 6.0
- name: "Analysis Flow for Yaml"
+ name: "Analysis"
product_uom: product.uom_day
project_id: project_project_developyamlproject0
responsible_id: project.res_users_analyst
state: draft
--
- I update the Constrain Date Start adn Date End for phase Analysis Flow for Yaml.
--
+-
+ I update the constrain and the analysis phase to not start before 4 days.
+-
!python {model : project.phase }: |
+ pass
import datetime
from dateutil.relativedelta import *
- 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})
-
--
- I create project phase 'Develop yaml' with constraint date.
--
+ start = datetime.date.today() + relativedelta(days=4)
+ self.write(cr,uid, [(ref("project_phase_analysisflowforyaml0"))], {'constraint_date_start': start})
+-
+ The second phase is 'Development' and depend on the 'Analysis', with a duration of 6 days.
+-
!record {model: project.phase, id: project_phase_developyaml0}:
duration: 6.0
- name: Develop Yaml
+ name: Development
product_uom: product.uom_day
project_id: project_project_developyamlproject0
- responsible_id: base.user_admin
previous_phase_ids:
- 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 }: |
+ pass
import datetime
- 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})
--
- I create project phase 'Test Yaml'.
+ #from dateutil.relativedelta import *
+ #start = datetime.date.today() - relativedelta(days=5)
+ #end = datetime.date.today() + relativedelta(days=10)
+ #self.write(cr,uid, [(ref("project_phase_developyaml0"))], {'constraint_date_start': start, 'constraint_date_end':end})
-
+ The third phase is 'Testing' and depend on the 'Develop' phase, with a duration of 6 days.
+-
!record {model: project.phase, id: project_phase_testyaml0}:
duration: 6.0
- name: Testing Yaml
+ name: Testing
product_uom: product.uom_day
project_id: project_project_developyamlproject0
previous_phase_ids:
- project_phase_developyaml0
- constraint_date_start :
- constraint_date_end :
--
- I compute Schedule of phases For One project.
--
+-
+ Then I launch the scheduler to compute starting and ending phases on all phases of this project.
+-
!record {model: project.compute.phases, id: project_compute_phases_0}:
project_id: project_project_developyamlproject0
target_project: one
-
--
- 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.
- 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]
- 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")
--
- 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.
+ After scheduling, I check the starting date and ending date on the phases are correct.
-
!python {model: project.phase}: |
- field_name = 'test'
- arg = {}
- self._compute(cr, uid, [ref("project_phase_developyaml0")], field_name, arg, context=None)
+ import datetime
+ from dateutil.relativedelta import *
+ minstart = (datetime.date.today() + relativedelta(days=4)).strftime('%Y-%m-%d')
+ minend = (datetime.date.today() + relativedelta(days=11)).strftime('%Y-%m-%d')
+
+ phase1=self.browse(cr, uid, ref('project_phase_analysisflowforyaml0'))
+ assert phase1.date_start>=minstart, 'Error, the Analysis phase '+phase1.date_start+' should start after '+str(minstart)
+ assert phase1.date_end>=minend, 'Error, the Analysis phase should end after '+str(minend)
+
+ phase2=self.browse(cr, uid, ref('project_phase_developyaml0'))
+ assert phase2.date_start>=phase1.date_end, 'Error, the phase Development should start after the end of the Analysis phase'
+
+ phase3=self.browse(cr, uid, ref('project_phase_testyaml0'))
+ assert phase3.date_start>=phase2.date_end, 'Error, the phase Testing should start after the end of the Development phase'
+ assert phase3.date_start<phase3.date_end, 'Error, the phase Testing should start before ending'
--
- 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}: |
- 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
--
- 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")])
--
- I create a project 'Develop yaml Project Module'.
--
+-
+ 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
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
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"
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")})
--
- I create 3 a project phase.
- First 'Analysis Flow for Yaml'Project Phase.
--
+-
+ 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
product_uom: product.uom_day
project_id: project_project_developyamlproject_2
state: draft
-
--
- I create project phase 'Develop yaml'.
--
+
+-
+ Create project phase 'Develop yaml'
+-
!record {model: project.phase, id: project_project_developyamlproject_2_Phase2}:
duration: 5.0
name: Develop Yaml
project_id: project_project_developyamlproject_2
previous_phase_ids:
- project_project_developyamlproject_2_Phase1
-
--
- I create project phase 'Test Yaml'.
--
+
+-
+ 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
-
--
- I compute Schedule of phases For One project.
--
+ - project_project_developyamlproject_2_Phase2
+
+-
+ 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
-
--
- I schedule project phases using Compute Phase Scheduling.
--
+
+-
+ 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.
-
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")
+
--
- I schedule the task.
--
- !record {model: project.schedule.tasks, id: project_schedule_tasks_0}:
- msg: Task Scheduling Completed Successfully
-
--
- 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)
-
- I create a project 'Develop yaml Implementation Module'.
+ 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')
--
- I create 4 Project phase.
- First Project Phase 'Analysis Flow for Yaml'.
--
+-
+ 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
project_id: project_project_developyamlproject_2
responsible_id: project.res_users_analyst
state: draft
-
--
- I create project phase 'Develop yaml'.
--
+
+-
+ Create project phase 'Develop yaml'
+-
!record {model: project.phase, id: project_project_developyamlproject_2_phase_2}:
duration: 6.0
name: "Develop yaml"
previous_phase_ids:
- project_project_developyamlproject_2_phase_1
state: draft
--
- I create project phase 'Test Yaml'.
--
+-
+ 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
--
- I create project phase 'Implement Yaml'.
--
+-
+ 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
--
- I compute Schedule of phases For One project .
--
+-
+ 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
-
--
- I schedule project phases using Compute Phase Scheduling.
--
+
+-
+ 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.
-
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")
+
+
--
- I create project 'Develop an outlook-openerp synchronization plugin'.
--
+-
+ Create project 'Develop an outlook-openerp synchronization plugin'
+-
!record {model: project.project, id: project_project_project4}:
name: Develop an outlook-openerp synchronization plugin
members:
- project.res_users_tester
- project.res_users_analyst
- project.res_users_finacial_manager
--
- I create phase 'Develop GUI' in Outlook.
--
+-
+ 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
- resource_id: project_long_term.resource_designer
- resource_id: project_long_term.resource_tester
- resource_id: project_long_term.resource_project_manager
-
--
- I create the phase task 'Develop GUI for Server Configuration'.
--
+
+-
+ 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
phase_id: project_phase_phase0
project_id: project_project_project4
-
--
- I create the phase task 'Develop GUI for Modules Configuration'.
--
+
+-
+ 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
phase_id: project_phase_phase0
project_id: project_project_project4
--
- I create the phase task 'Develop GUI for OpenERP Synchronisation'.
--
+-
+ 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
phase_id: project_phase_phase0
project_id: project_project_project4
--
- I create the phase task 'Design required GUI/Menus'.
--
+-
+ 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
state: draft
phase_id: project_phase_phase0
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")])
-
- I check if tasks scheduled, check that either of task's start_date, end_date and user_id is not null.
+ 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]
-
- I create a project 'World Bank's Project'.
+ Create a project 'World Bank's Project'
-
!record {model: project.project, id: project_project_worldbanksproject0}:
name: "World Bank's Project"
- project.res_users_tester
-
- I create a project phase 'Defining Client's Basic Idea of Project'.
+ 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')
project_id: project_project_worldbanksproject0
-
- I create project phase 'Establishing Project Feasibility'.
+ Create project phase 'Establishing Project Feasibility'
-
!record {model: project.phase, id: project_phase_establishingprojectfeasibility0}:
date_start: !eval time.strftime('%Y-%m-%d')
!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
-
phase_id: project_phase_definingclientsbasicideaofproject0
-
- I create the phase task 'Develop GUI for Server Configuration'.
+ Create the phase task 'Develop GUI for Server Configuration'
-
!record {model: project.task, id: project_task_t0}:
name: Develop GUI for Server Configuration
project_id: project_project_worldbanksproject0
-
- I create the phase task 'Develop GUI for Modules Configuration'.
+ Create the phase task 'Develop GUI for Modules Configuration'
-
!record {model: project.task, id: project_task_t1}:
name: Develop GUI for Modules Configuration
project_id: project_project_worldbanksproject0
-
- I create project phase 'Preparation of Engineering Designs'.
+ Create project phase 'Preparation of Engineering Designs'
-
!record {model: project.phase, id: project_phase_preparationofengineeringdesigns0}:
date_start: !eval time.strftime('%Y-%m-%d')
phase_id: project_phase_preparationofengineeringdesigns0
-
- I create the phase task 'Develop GUI for Client Configuration'.
+ Create the phase task 'Develop GUI for Client Configuration'
-
!record {model: project.task, id: project_task_t2}:
name: Develop GUI for Server Configuration
project_id: project_project_worldbanksproject0
-
- I create the phase task 'Develop GUI for Client Module Configuration'.
+ Create the phase task 'Develop GUI for Client Module Configuration'
-
!record {model: project.task, id: project_task_t3}:
name: Develop GUI for Modules Configuration
-
- I create project phase 'Procurement of Works and Goods'.
+ Create project phase 'Procurement of Works and Goods'
-
!record {model: project.phase, id: project_phase_procurementofworksandgoods0}:
date_start: !eval time.strftime('%Y-%m-%d')
project_id: project_project_worldbanksproject0
-
- I create project phase 'Project Construction'.
+ Create project phase 'Project Construction'
-
!record {model: project.phase, id: project_phase_projectconstruction0}:
date_start: !eval time.strftime('%Y-%m-%d')
-
- I create project phase 'Project Completion'.
+ Create project phase 'Project Completion'
-
!record {model: project.phase, id: project_phase_projectcompletion0}:
date_start: !eval time.strftime('%Y-%m-%d')
project_id: project_project_worldbanksproject0
-
- I set previous phase for phase 'Establishing Project Feasibility'.
+ Set previous phase for phase 'Establishing Project Feasibility'
-
!record {model: project.phase, id: project_phase_establishingprojectfeasibility0}:
previous_phase_ids:
-
- I set previous phase for phase 'Preparation of Engineering Designs'.
+ Set previous phase for phase 'Preparation of Engineering Designs'
-
!record {model: project.phase, id: project_phase_preparationofengineeringdesigns0}:
previous_phase_ids:
- project_phase_establishingprojectfeasibility0
-
- I set previous phase for phase 'Procurement of Works and Goods'.
+ Set previous phase for phase 'Procurement of Works and Goods'
-
!record {model: project.phase, id: project_phase_procurementofworksandgoods0}:
previous_phase_ids:
- project_phase_preparationofengineeringdesigns0
-
- I set previous phase for phase 'Project Construction'.
+ Set previous phase for phase 'Project Construction'
-
!record {model: project.phase, id: project_phase_projectconstruction0}:
previous_phase_ids:
-
- I set previous phase for phase 'Project Completion'.
+ Set previous phase for phase 'Project Completion'
-
!record {model: project.phase, id: project_phase_projectcompletion0}:
previous_phase_ids:
-
- I get the project to schedule phases.
+ Get the project to schedule phases
-
!record {model: project.compute.phases, id: project_compute_phases_0}:
project_id: project_project_worldbanksproject0
-
- I schedule project phases.
+ Schedule project phases
-
!python {model: project.project}: |
self.schedule_phases(cr, uid, ref("project_project_worldbanksproject0"))
-
- I check if phases scheduled, check that either of phase's start_date, end_date and user_id is not null.
+ 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")
+
+
--
- I create project 'Develop a thunderbird-openerp synchronization plugin'.
--
+-
+ Create project 'Develop a thunderbird-openerp synchronization plugin'
+-
!record {model: project.project, id: project_project_project1}:
name: Develop a thunderbird-openerp synchronization plugin
members:
- project.res_users_tester
- project.res_users_analyst
- project.res_users_finacial_manager
-
--
- I create phase 'Develop GUI' in thunderbird.
--
+
+-
+ 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
useability: 30.0
- resource_id: project_long_term.resource_designer
useability: 30.0
-
-
--
- I create the phase task 'Develop GUI for Server Configuration'.
--
+
+
+-
+ 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
phase_id: project_phase_phase1
project_id: project_project_project1
user_id: project.res_users_developer
-
--
- I create the phase task 'Develop GUI for Modules Configuration'.
--
+
+-
+ 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
phase_id: project_phase_phase1
project_id: project_project_project1
user_id: project.res_users_developer
--
- I create the phase task 'Develop GUI for OpenERP Synchronisation'.
--
+-
+ 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
phase_id: project_phase_phase1
project_id: project_project_project1
user_id: project.res_users_developer
--
- I create the phase task 'Design required GUI/Menus'.
--
+-
+ 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
phase_id: project_phase_phase1
project_id: project_project_project1
user_id: project.res_users_designer
-
-
--
- I schedule tasks.
--
+
+
+-
+ Schedule tasks
+-
!python {model: project.project}: |
self.schedule_tasks(cr, uid, ref("project_project_project1"))
-
- I check if tasks scheduled, check that either of task's start_date, end_date and user_id is not null.
+ 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]
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')
- 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
!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'))
-
- 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'
name: Thursday
name: Working Time A
--
- I create a resource.calendar.attendance record.
--
+-
+ Creating 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
--
- I create a resource.calendar.attendance record.
--
+-
+ Creating 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
--
- I create a resource.calendar.attendance record.
--
+-
+ Creating 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
--
- I create a resource.calendar.attendance record.
--
+-
+ Creating 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'
hour_to: 18.0
name: Friday
name: Working Time B
--
- I create a resource.calendar.attendance record.
--
+-
+ Creating 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
- 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
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
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
-
!python {model: project.compute.phases}: |
self.check_selection(cr, uid, [ref("project_compute_phases0")])
+
-
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
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
- 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
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
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
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
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
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
],
'demo_xml': [
],
- 'test': ['test/test_project_mailgate.yml'],
'installable': True,
'active': False,
'certificate': '001075048780413258261',
+++ /dev/null
--
- 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
- 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')})
--
- 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')})
-
-
-
- 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.
categ_id: product.product_category_7
cost_method: standard
mes_type: fixed
- name: Partners Technical Training
+ name: Partners Training
procure_method: make_to_order
supply_method: produce
type: service
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
order_line:
- state: draft
delay: 7.0
- name: Partners Technical Training
+ name: Partners Training
price_unit: 1.0
product_id: product_product_partnerstraining0
product_uom: product.uom_day
-
!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'))
- 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)
+
--
- I create a analytic planning 'Project Planning'.
--
+-
+ 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')
name: Project Planning
state: draft
user_id: base.user_demo
-
-
--
- Open the 'Project Planning'.
--
+
+
+-
+ Open the 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")],
ref("project_planning.menu_report_account_analytic_planning"), "search_default_user_id":
1, "project_id": False, "department_id": False, })
-
- I check if 'Project Planning' in open state.
+ Check if 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"
--
- I cancel the 'Project Planning'.
--
+-
+ Cancel the 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")],
ref("project_planning.menu_report_account_analytic_planning"), "search_default_user_id":
1, "project_id": False, "department_id": False, })
-
- 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'.
+ Check if 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
+-
!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")],
ref("project_planning.menu_report_account_analytic_planning"), "search_default_user_id":
1, "project_id": False, "department_id": False, })
-
- 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'.
+ Check if 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
+-
!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")],
ref("project_planning.menu_report_account_analytic_planning"), "search_default_user_id":
1, "project_id": False, "department_id": False, })
-
- 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'.
+ Check if 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
+-
!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")],
"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)
--
- 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
--
- 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.
--
- !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)
-
-
- I check if 'Project Planning' in done state.
+ Check if planning in done state
-
- !assert {model: report_account_analytic.planning, id: report_account_analytic_planning_projectplanning0, string: Planning in done state}:
+ !assert {model: report_account_analytic.planning, id: report_account_analytic_planning_projectplanning0, string: Planning in done state}:
- state == "done"
-
- 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)
+ file(os.path.join(tools.config['test_report_directory'], 'project_planning-project_planning_report'+format), 'wb+').write(data)
\ No newline at end of file
--
- I create project 'Retro Planning'.
--
+-
+ 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
--
- I create task 'Plan all projects'.
--
+
+-
+ 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)"
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/scrum_sprint_test.yml'
- ],
+ 'test': ['test/project_scrum_report.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.
--
- I create project 'OpenERP Training Programme'.
--
- !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.
--
+ 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)
--
- I create 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
--
- 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.
--
- !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)
--
- I click on Open Button.
--
- !python {model: project.scrum.product.backlog}: |
- self.button_open(cr, uid, [ref("project_scrum_product_backlog0")],context=None)
--
- I click on Pending Button.
--
- !python {model: project.scrum.product.backlog}: |
- self.button_pending(cr, uid, [ref("project_scrum_product_backlog0")],context=None)
--
- I click on Open Button.
--
- !python {model: project.scrum.product.backlog}: |
- self.button_open(cr, uid, [ref("project_scrum_product_backlog0")],context=None)
--
- 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.
--
- !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
--
- 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
--
- I create second scrum backlog for merge the record.
--
- !record {model: project.scrum.backlog.merge, id: project_scrum_backlog_merge2}:
- project_id: project_project_1
--
- Set project scrum backlog merge.
--
- !python {model: project.scrum.backlog.merge}: |
- 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.
--
- !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)
-
--
- I create 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
-
--
- I create 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)
--
- I click on Postpone Button.
--
- !python {model: project.scrum.product.backlog}: |
- self.button_postpone(cr, uid, [ref("project_scrum_product_backlog0")],context=None)
--
- I click on Close Button.
--
- !python {model: project.scrum.product.backlog}: |
- self.button_close(cr, uid, [ref("project_scrum_product_backlog0")],context=None)
--
- I click on Cancel Button.
--
- !python {model: project.scrum.product.backlog}: |
- self.button_cancel(cr, uid, [ref("project_scrum_product_backlog0")],context=None)
--
- I 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
+ 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
+++ /dev/null
--
- I create 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")])
-
- I create a user 'HR Manager'.
+ Create a user 'HR Manager'
-
!record {model: res.users, id: res_users_hrmanager0}:
company_id: base.main_company
- base.group_hr_manager
-
- I create a product with type service used to specify employees designation.
+ 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
weight_net: 0.0
-
- I create an analytic journal for employees timesheet.
+ Create an analytic journal for employees timesheet
-
!record {model: account.analytic.journal, id: account_analytic_journal_hrtimesheet0}:
company_id: base.main_company
type: general
-
- I create an employee 'HR Manager' for user 'HR Manager'.
+ Create an employee 'HR Manager' for user 'HR Manager'
-
!record {model: hr.employee, id: hr_employee_hrmanager0}:
name: HR Manager
journal_id: account_analytic_journal_hrtimesheet0
-
- I create a timesheet sheet for HR manager.
+ 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')
employee_id : 'hr_employee_hrmanager0'
-
- I create a project 'Timesheet Management'.
+ Create a project 'Timesheet Management'
-
!record {model: project.project, id: project_project_timesheetmanagement0}:
company_id: base.main_company
name: Timesheet Management
-
--
- 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)
+
-
- I create a task 'Get all timesheet records'.
+ 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')
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":
"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.
+ 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:
hours: 10.0
name: Get work calendar of all employees
user_id: res_users_hrmanager0
+
-
- I create 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')])
--
- I check for timesheet_ids in HR manager's timesheet.
+ 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
-