details:   https://code.openbravo.com/erp/devel/pi/rev/c5f112181318
changeset: 32513:c5f112181318
user:      Armaignac <collazoandy4 <at> gmail.com>
date:      Thu Jul 20 17:54:57 2017 -0400
summary:   Fixes issue 36448: The Line number in RTV is increase in 10

The Line number in RTV is increase in 10 every time you open the Pick/Edit lines
even without any change

The OBCriteria to get the max lineno was remove because the orderlines are
always created

diffstat:

 src/org/openbravo/common/actionhandler/SRMOPickEditLines.java |  12 +----------
 1 files changed, 1 insertions(+), 11 deletions(-)

diffs (36 lines):

diff -r 6a599106f399 -r c5f112181318 
src/org/openbravo/common/actionhandler/SRMOPickEditLines.java
--- a/src/org/openbravo/common/actionhandler/SRMOPickEditLines.java     Thu Jul 
20 10:41:52 2017 -0400
+++ b/src/org/openbravo/common/actionhandler/SRMOPickEditLines.java     Thu Jul 
20 17:54:57 2017 -0400
@@ -29,15 +29,12 @@
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
-import org.hibernate.criterion.Projections;
-import org.hibernate.criterion.Restrictions;
 import org.openbravo.base.exception.OBException;
 import org.openbravo.base.provider.OBProvider;
 import org.openbravo.base.secureApp.VariablesSecureApp;
 import org.openbravo.client.application.process.BaseProcessActionHandler;
 import org.openbravo.client.kernel.RequestContext;
 import org.openbravo.dal.core.OBContext;
-import org.openbravo.dal.service.OBCriteria;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.dal.service.OBDao;
 import org.openbravo.erpCommon.utility.OBMessageUtils;
@@ -130,15 +127,8 @@
       removeNonSelectedLines(idList, order);
       return;
     }
-    OBCriteria<OrderLine> obc = 
OBDal.getInstance().createCriteria(OrderLine.class);
-    obc.add(Restrictions.eq(OrderLine.PROPERTY_SALESORDER, order));
-    obc.setProjection(Projections.max(OrderLine.PROPERTY_LINENO));
+
     Long lineNo = 0L;
-    Object o = obc.list().get(0);
-    if (o != null) {
-      lineNo = (Long) o;
-    }
-
     boolean isUomManagementEnabled = UOMUtil.isUomManagementEnabled();
     for (long i = 0; i < selectedLines.length(); i++) {
       JSONObject selectedLine = selectedLines.getJSONObject((int) i);

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to