[ADD] project_long_term: Added a yaml.
bzr revid: uco@tinyerp.com-20110103121656-7vywdw4s6cc5hao4
This commit is contained in:
parent
afc3d51b36
commit
051d553d70
|
@ -42,7 +42,8 @@ Features.
|
|||
"test": [
|
||||
'test/schedule_project_phases.yml',
|
||||
'test/schedule_project_tasks.yml',
|
||||
'test/schedule_phase_tasks.yml'
|
||||
'test/schedule_phase_tasks.yml',
|
||||
'test/test_schedule_phases_case1.yml',
|
||||
],
|
||||
"update_xml": [
|
||||
"security/ir.model.access.csv",
|
||||
|
|
|
@ -0,0 +1,65 @@
|
|||
-
|
||||
In order to test scheduling of project phases, I create two different phases and
|
||||
test it with two different dates for scheduling.
|
||||
-
|
||||
I create a project 'Development and Testing'.
|
||||
-
|
||||
!record {model: project.project, id: project_project_project0}:
|
||||
date_start: '2010-12-30'
|
||||
balance: 0.0
|
||||
credit: 0.0
|
||||
currency_id: base.EUR
|
||||
debit: 0.0
|
||||
effective_hours: 0.0
|
||||
members:
|
||||
- base.user_admin
|
||||
name: Development and Testing
|
||||
planned_hours: 0.0
|
||||
progress_rate: 0.0
|
||||
quantity: 0.0
|
||||
quantity_max: 0.0
|
||||
state: open
|
||||
type_ids:
|
||||
- project.project_tt_specification
|
||||
- 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}:
|
||||
duration: 2.0
|
||||
name: First Phase
|
||||
product_uom: product.uom_day
|
||||
project_id: project_project_project0
|
||||
state: draft
|
||||
-
|
||||
I create second phase of the project.
|
||||
-
|
||||
!record {model: project.phase, id: project_phase_secondphase0}:
|
||||
duration: 3.0
|
||||
name: Second Phase
|
||||
previous_phase_ids:
|
||||
- project_phase_firstphase0
|
||||
product_uom: product.uom_day
|
||||
project_id: project_project_project0
|
||||
state: draft
|
||||
-
|
||||
Now I create a record to compute the phase of project.
|
||||
-
|
||||
!record {model: project.compute.phases, id: project_compute_phases0}:
|
||||
target_project: 'one'
|
||||
project_id: project_project_project0
|
||||
-
|
||||
I schedule the phases.
|
||||
-
|
||||
!python {model: project.compute.phases}: |
|
||||
self.check_selection(cr, uid, [ref("project_compute_phases0")])
|
||||
-
|
||||
I check the starting and ending dates of both phases.
|
||||
-
|
||||
!python {model: project.phase}: |
|
||||
first_phase = self.browse(cr, uid, ref('project_phase_firstphase0'))
|
||||
assert (first_phase.date_start == '2010-12-30' and first_phase.date_end == '2010-12-31'),'Dates are wrong!'
|
||||
second_phase = self.browse(cr, uid, ref('project_phase_secondphase0'))
|
||||
assert (second_phase.date_start == '2011-01-01' and second_phase.date_end == '2011-01-03'),'Dates are wrong!'
|
Loading…
Reference in New Issue