ItEr39S05ValidacionEProbasFuncionaisItEr38S05: [Bug #185] Fixing bug. It happened when removing an order element that has been scheduled.
Only TaskSources for scheduling points can store HoursGroups. If not, when erasing the OrderElement containing an HourGroup an error can happen.
This commit is contained in:
parent
37ddef3cec
commit
f4241f0832
1 changed files with 6 additions and 2 deletions
|
|
@ -28,6 +28,7 @@ import org.apache.commons.lang.Validate;
|
|||
import org.hibernate.validator.NotNull;
|
||||
import org.navalplanner.business.common.BaseEntity;
|
||||
import org.navalplanner.business.common.exceptions.InstanceNotFoundException;
|
||||
import org.navalplanner.business.orders.entities.SchedulingState.Type;
|
||||
import org.navalplanner.business.planner.daos.ITaskElementDAO;
|
||||
import org.navalplanner.business.planner.daos.ITaskSourceDAO;
|
||||
import org.navalplanner.business.planner.entities.Task;
|
||||
|
|
@ -255,8 +256,11 @@ public class TaskSource extends BaseEntity {
|
|||
public TaskSource(OrderElement orderElement) {
|
||||
Validate.notNull(orderElement);
|
||||
this.setOrderElement(orderElement);
|
||||
this.setHoursGroups(new HashSet<HoursGroup>(orderElement
|
||||
.getHoursGroups()));
|
||||
Type orderElementType = orderElement.getSchedulingState().getType();
|
||||
if (orderElementType == SchedulingState.Type.SCHEDULING_POINT) {
|
||||
this.setHoursGroups(new HashSet<HoursGroup>(orderElement
|
||||
.getHoursGroups()));
|
||||
}
|
||||
}
|
||||
|
||||
public TaskSourceSynchronization withCurrentHoursGroup(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue