[FIX]project: Error when no date given in the selected project in Scheduling Task Wizard and Press Compute button

bzr revid: mma@tinyerp.com-20121101133024-cvg0lixafru3arjm
This commit is contained in:
Somesh Khare(OpenERP) 2012-11-01 19:00:24 +05:30 committed by Mayur Maheshwari (OpenERP)
parent b006809773
commit eb4b42e85f
1 changed files with 2 additions and 0 deletions

View File

@ -429,6 +429,8 @@ def Project():
return result
def _schedule_project(self, cr, uid, project, context=None):
if not project.date_start:
raise osv.except_osv(_('Warning !'),_("You must assign Start Date on the Project '%s' !") % (project.name,))
resource_pool = self.pool.get('resource.resource')
calendar_id = project.resource_calendar_id and project.resource_calendar_id.id or False
working_days = resource_pool.compute_working_calendar(cr, uid, calendar_id, context=context)