Fix bug #1642
When checking the condition `isOnlyChildAndParentAlreadyInUseByHoursOrExpenses` the parent might be a new object. In that case the check if false and no further querying must be done in the parent.
This commit is contained in:
parent
d57890ffa8
commit
70a8013eb9
1 changed files with 2 additions and 1 deletions
|
|
@ -931,7 +931,8 @@ public class OrderModel extends IntegrationEntityModel implements IOrderModel {
|
|||
OrderElement orderElement) {
|
||||
try {
|
||||
OrderLineGroup parent = orderElement.getParent();
|
||||
if (!parent.isOrder() && parent.getChildren().size() == 1) {
|
||||
if (!parent.isOrder() && !parent.isNewObject()
|
||||
&& parent.getChildren().size() == 1) {
|
||||
if (orderElementDAO.isAlreadyInUse(parent)) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue