From 5477d0de864d9919dc8578a8b3bea172a27a1618 Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Fri, 2 Jul 2010 19:45:50 +0530 Subject: [IMP] clean project_* code (ARA) bzr revid: mra@mra-laptop-20100702141550-05xl1o45ophjl23t --- addons/project_long_term/wizard/__init__.py | 1 - .../wizard/project_compute_phases.py | 5 +++- .../wizard/project_compute_phases_view.xml | 32 +++++++++++----------- .../wizard/project_compute_tasks.py | 4 +-- .../wizard/project_compute_tasks_view.xml | 2 +- .../wizard/project_schedule_tasks.py | 6 +++- .../wizard/project_schedule_tasks_view.xml | 4 +-- .../project_long_term/wizard/working_calendar.py | 21 ++++++++++---- 8 files changed, 45 insertions(+), 30 deletions(-) (limited to 'addons/project_long_term/wizard') diff --git a/addons/project_long_term/wizard/__init__.py b/addons/project_long_term/wizard/__init__.py index fb8a29449f7..5056cad3b77 100644 --- a/addons/project_long_term/wizard/__init__.py +++ b/addons/project_long_term/wizard/__init__.py @@ -25,4 +25,3 @@ import project_schedule_tasks import working_calendar # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/project_long_term/wizard/project_compute_phases.py b/addons/project_long_term/wizard/project_compute_phases.py index ce2e2c0bbb1..3b4ac2d7b23 100644 --- a/addons/project_long_term/wizard/project_compute_phases.py +++ b/addons/project_long_term/wizard/project_compute_phases.py @@ -18,6 +18,7 @@ # along with this program. If not, see . # ############################################################################## + import datetime from resource.faces import * from new import classobj @@ -48,6 +49,8 @@ class project_compute_phases(osv.osv_memory): return self.compute_date(cr, uid, ids, context=context) def _phase_schedule(self, cr, uid, phase, start_date, calendar_id=False, context=None): + if context is None: + context = {} """Schedule phase with the start date till all the next phases are completed. Arguements: start_dsate -- start date for the phase @@ -118,7 +121,7 @@ class project_compute_phases(osv.osv_memory): context=ctx) # Recursive call till all the next phases scheduled for phase in phase.next_phase_ids: - if phase.state in ['draft','open','pending']: + if phase.state in ['draft', 'open', 'pending']: id_cal = phase.project_id.resource_calendar_id and phase.project_id.resource_calendar_id.id or False self._phase_schedule(cr, uid, phase, date_start, id_cal, context=context) else: diff --git a/addons/project_long_term/wizard/project_compute_phases_view.xml b/addons/project_long_term/wizard/project_compute_phases_view.xml index 6bbb01ca7e4..8a9ce15e772 100644 --- a/addons/project_long_term/wizard/project_compute_phases_view.xml +++ b/addons/project_long_term/wizard/project_compute_phases_view.xml @@ -9,20 +9,20 @@
- - - - - - - - -