Bug #1485: Call model.initEdit to ensure proxies are initialized before loading

monthly timesheet screen.

FEA: ItEr76S04BugFixing
This commit is contained in:
Jacobo Aragunde Pérez 2012-07-09 17:41:30 +02:00
parent de6b8dbf72
commit 98d3152631
3 changed files with 9 additions and 1 deletions

View file

@ -243,4 +243,6 @@ public interface IWorkReportModel extends IIntegrationEntityModel {
*/
boolean isMonthlyTimesheet(WorkReport workReport);
WorkReportLine getFirstWorkReportLine();
}

View file

@ -630,7 +630,8 @@ public class WorkReportCRUDController extends GenericForwardComposer implements
}
private void goToEditMonthlyTimeSheet(WorkReport workReport) {
Date date = workReport.getWorkReportLines().iterator().next().getDate();
workReportModel.initEdit(workReport);
Date date = workReportModel.getFirstWorkReportLine().getDate();
Resource resource = workReport.getResource();
monthlyTimesheetController.goToCreateOrEditFormForResource(
LocalDate.fromDateFields(date), resource);

View file

@ -639,4 +639,9 @@ public class WorkReportModel extends IntegrationEntityModel implements
}
}
@Override
public WorkReportLine getFirstWorkReportLine() {
return workReport.getWorkReportLines().iterator().next();
}
}