Bug #1369: Fix problem when a template defines a calendar in new project pop-up

Use the calendar from the combo as they are already properly loaded.

FEA: ItEr76S04BugFixing
This commit is contained in:
Manuel Rego Casasnovas 2012-06-27 12:26:47 +02:00
parent 760a61d3f1
commit db9a8a5510

View file

@ -292,7 +292,17 @@ public class ProjectDetailsController extends GenericForwardComposer {
.setTooltiptext(_("Code has to be autogenerated to create a new project from templates"));
generateCode.setChecked(true);
calculateProjectDates(template);
setBaseCalendar(template.getCalendar());
setCalendarFromTemplate(template);
}
}
private void setCalendarFromTemplate(OrderTemplate template) {
BaseCalendar calendar = template.getCalendar();
for (BaseCalendar each : getBaseCalendars()) {
if (calendar.getId().equals(each.getId())) {
setBaseCalendar(each);
return;
}
}
}