[Bug #1195] Fix bug
When using the owner scenario the allocations must also be switched to the current scenario. A lazy initialization exception is also avoided reattaching the resources of the allocation to be removed. FEA: ItEr75S04BugFixing
This commit is contained in:
parent
8bf213bd4e
commit
9687f23032
2 changed files with 8 additions and 0 deletions
|
|
@ -404,6 +404,9 @@ public class AllocationRowsHandler {
|
|||
for (AllocationRow each : currentRows) {
|
||||
result.addAll(each.getAssociatedResources());
|
||||
}
|
||||
for (ResourceAllocation<?> each : requestedToRemove) {
|
||||
result.addAll(each.getAssociatedResources());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -304,6 +304,8 @@ public class PlanningStateCreator {
|
|||
private IScenarioInfo buildScenarioInfo(Order orderReloaded) {
|
||||
Scenario currentScenario = scenarioManager.getCurrent();
|
||||
if (orderReloaded.isUsingTheOwnerScenario()) {
|
||||
switchAllocationsToScenario(currentScenario,
|
||||
orderReloaded.getAssociatedTaskElement());
|
||||
return new UsingOwnerScenario(currentScenario, orderReloaded);
|
||||
}
|
||||
final List<DayAssignment> previousAssignments = orderReloaded
|
||||
|
|
@ -323,6 +325,9 @@ public class PlanningStateCreator {
|
|||
|
||||
private static void switchAllocationsToScenario(Scenario scenario,
|
||||
TaskElement task) {
|
||||
if (task == null) {
|
||||
return;
|
||||
}
|
||||
for (ResourceAllocation<?> each : task.getAllResourceAllocations()) {
|
||||
each.switchToScenario(scenario);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue