[Bug #861] Fix bug

Deleting the order elements without parents after the task sources
have been synchronized.

When an OrderElement is removed it's left behind whithout parent. The
method deleteOrderElementWithoutParent is responsible of deleting
them.  If this is done before doing the tasks synchronization, the
associated TaskGroup to the OrderGroup removed has as children the
moved task. This causes said task to be processed twice, from two
differnet possitions: at the OrderGroup removed and at the position it
was added.

Now deleteOrderElementWithoutParent it's done after the
synchronization, so the associated TaskGroup doesn't have the moved
task.

FEA: ItEr71S04BugFixing
This commit is contained in:
Óscar González Fernández 2011-02-21 19:31:33 +01:00
parent b6590e691a
commit 626ba85f8f

View file

@ -530,7 +530,6 @@ public class OrderModel extends IntegrationEntityModel implements IOrderModel {
calculateAndSetTotalHours();
orderDAO.save(order);
reattachCurrentTaskSources();
deleteOrderElementWithoutParent();
if (newOrderVersionNeeded) {
OrderVersion newVersion = OrderVersion
.createInitialVersion(currentScenario);
@ -549,6 +548,7 @@ public class OrderModel extends IntegrationEntityModel implements IOrderModel {
}
saveDerivedScenarios();
calculateAdvancePercentageIncludingChildren(order);
deleteOrderElementWithoutParent();
}
private void calculateAdvancePercentageIncludingChildren(OrderElement order) {