From 0d2ae40a70ba3be3ccf8e439b4ed92a1ec4719d6 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Wed, 26 Oct 2011 01:31:41 +0200 Subject: [FIX] Complete refactoring of project_long_term, with following changes: do not use resources but users on phases: - to be consistent with project members and task responsible - if the user is linked to a resource, it uses the calendar of the resource (holidays for example) better YML tests Complete rewrite of the scheduling mechanism: - Schedule phases: - write project.user.allocation based on scheduling - schedule resources based on members on the project - new constraint: force some users on a phase - Schedule tasks: - set user if no user on task - set start and end date some useability improvements We still have to work on better Gantt view but I think the scheduling is working correctly now. bzr revid: fp@tinyerp.com-20111025233141-cgctwe8spxhko2gn --- .../test/schedule_project_tasks.yml | 26 ++++++++-------------- 1 file changed, 9 insertions(+), 17 deletions(-) (limited to 'addons/project_long_term/test/schedule_project_tasks.yml') diff --git a/addons/project_long_term/test/schedule_project_tasks.yml b/addons/project_long_term/test/schedule_project_tasks.yml index 825b7c404d9..17db7ef8038 100644 --- a/addons/project_long_term/test/schedule_project_tasks.yml +++ b/addons/project_long_term/test/schedule_project_tasks.yml @@ -11,26 +11,17 @@ - project.res_users_tester - project.res_users_analyst - project.res_users_finacial_manager - + - Create phase 'Develop GUI' in thunderbird - !record {model: project.phase, id: project_phase_phase1}: - date_start: !eval time.strftime('%Y-%m-%d') + date_start: !eval time.strftime('%Y-%m-%d %H:%M:%S') duration: 200.0 name: Develop GUI in thunderbird product_uom: product.uom_day project_id: project_project_project1 state: draft - resource_ids: - - resource_id: project_long_term.resource_analyst - useability: 80.0 - - resource_id: project_long_term.resource_developer - useability: 30.0 - - resource_id: project_long_term.resource_designer - useability: 30.0 - - - Create the phase task 'Develop GUI for Server Configuration' - @@ -76,8 +67,7 @@ phase_id: project_phase_phase1 project_id: project_project_project1 user_id: project.res_users_designer - - + - Schedule tasks - @@ -88,7 +78,9 @@ 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] - for task in prj.tasks: - if (not task.user_id) or (not task.date_start) or (not task.date_end): - raise AssertionError("Project Tasks not scheduled") + prj = self.browse(cr, uid, [ref("project_project_project1")])[0] + for task in prj.tasks: + if task.state in ('done','cancelled'): + continue + if (not task.user_id) or (not task.date_start) or (not task.date_end): + raise AssertionError("Project tasks not scheduled!") -- cgit v1.2.3