- Create a project 'World Bank's Project' - !record {model: project.project, id: project_project_worldbanksproject0}: name: "World Bank's Project" priority: 4 - Create a project phase 'Defining Client's Basic Idea of Project' - !record {model: project.phase, id: project_phase_definingclientsbasicideaofproject0}: date_start: '2010-06-02' duration: 15.0 name: "Defining Client's Basic Idea of Project" product_uom: product.uom_day project_id: project_project_worldbanksproject0 - Create project phase 'Establishing Project Feasibility' - !record {model: project.phase, id: project_phase_establishingprojectfeasibility0}: date_start: '2010-06-02' duration: 30.0 name: Establishing Project Feasibility product_uom: product.uom_day project_id: project_project_worldbanksproject0 - Create project phase 'Preparation of Engineering Designs' - !record {model: project.phase, id: project_phase_preparationofengineeringdesigns0}: date_start: '2010-06-02' duration: 100.0 name: Preparation of Engineering Designs product_uom: product.uom_hour project_id: project_project_worldbanksproject0 - Create project phase 'Procurement of Works and Goods' - !record {model: project.phase, id: project_phase_procurementofworksandgoods0}: date_start: '2010-06-02' duration: 24.0 name: Procurement of Works and Goods product_uom: product.uom_hour project_id: project_project_worldbanksproject0 - Create project phase 'Project Construction' - !record {model: project.phase, id: project_phase_projectconstruction0}: date_start: '2010-06-02' duration: 4320.0 name: Project Construction product_uom: product.uom_hour project_id: project_project_worldbanksproject0 - Create project phase 'Project Completion' - !record {model: project.phase, id: project_phase_projectcompletion0}: date_start: '2010-06-02' duration: 240.0 name: Project Completion product_uom: product.uom_hour project_id: project_project_worldbanksproject0 - Set previous phase for phase 'Establishing Project Feasibility' - !record {model: project.phase, id: project_phase_establishingprojectfeasibility0}: previous_phase_ids: - project_phase_definingclientsbasicideaofproject0 - Set previous phase for phase 'Preparation of Engineering Designs' - !record {model: project.phase, id: project_phase_preparationofengineeringdesigns0}: previous_phase_ids: - project_phase_establishingprojectfeasibility0 - Set previous phase for phase 'Procurement of Works and Goods' - !record {model: project.phase, id: project_phase_procurementofworksandgoods0}: previous_phase_ids: - project_phase_preparationofengineeringdesigns0 - Set previous phase for phase 'Project Construction' - !record {model: project.phase, id: project_phase_projectconstruction0}: previous_phase_ids: - project_phase_procurementofworksandgoods0 - Set previous phase for phase 'Project Completion' - !record {model: project.phase, id: project_phase_projectcompletion0}: previous_phase_ids: - project_phase_projectconstruction0 - Get the project to schedule phases - !record {model: project.compute.phases, id: project_compute_phases_0}: project_id: project_project_worldbanksproject0 target_project: one - Schedule project phases - !python {model: project.project}: | self.schedule_phases(cr, uid, ref("project_project_worldbanksproject0")) - Check if phases scheduled, check that either of phase's start_date, end_date and user_id is not null - !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")