Related to issue 37603: Backed out changeset 6b875b0a1505
authorAsier Martirena <asier.martirena@openbravo.com>
Thu, 05 Jul 2018 10:00:54 +0200
changeset 34269 e21023f96bf5
parent 34268 f4e9ff9ed7bb
child 34270 fdc9ea867984
child 34437 b1e1b6b91f24
Related to issue 37603: Backed out changeset 6b875b0a1505
src/org/openbravo/erpCommon/businessUtility/CancelAndReplaceUtils.java
--- a/src/org/openbravo/erpCommon/businessUtility/CancelAndReplaceUtils.java	Thu Jul 05 09:47:14 2018 +0200
+++ b/src/org/openbravo/erpCommon/businessUtility/CancelAndReplaceUtils.java	Thu Jul 05 10:00:54 2018 +0200
@@ -1030,19 +1030,15 @@
     final OBCriteria<OrderLine> oldOrderLineCriteria = OBDal.getInstance().createCriteria(
         OrderLine.class);
     oldOrderLineCriteria.add(Restrictions.eq(OrderLine.PROPERTY_SALESORDER, oldOrder));
-    oldOrderLineCriteria.add(Restrictions.eq(OrderLine.PROPERTY_OBPOSISDELETED, false));
     for (final OrderLine oldOrderLine : oldOrderLineCriteria.list()) {
       final StringBuffer where = new StringBuffer();
-      where.append(" WHERE " + OrderlineServiceRelation.PROPERTY_SALESORDERLINE + "."
-          + OrderLine.PROPERTY_ID + " IN :cancellingLines");
-      where.append(" AND (" + OrderlineServiceRelation.PROPERTY_SALESORDERLINE
+      where.append(" WHERE (" + OrderlineServiceRelation.PROPERTY_SALESORDERLINE
           + " = :salesorderline");
       where.append(" OR " + OrderlineServiceRelation.PROPERTY_ORDERLINERELATED
           + " = :salesorderline)");
       final OBQuery<OrderlineServiceRelation> serviceRelationQuery = OBDal.getInstance()
           .createQuery(OrderlineServiceRelation.class, where.toString());
       serviceRelationQuery.setNamedParameter("salesorderline", oldOrderLine);
-      serviceRelationQuery.setNamedParameter("cancellingLines", linesRelations.keySet());
       for (final OrderlineServiceRelation serviceRelation : serviceRelationQuery.list()) {
         if (!createdRelations.contains(serviceRelation.getId())) {
           createdRelations.add(serviceRelation.getId());