Openbravo Issue Tracking System - Retail Modules
View Issue Details
0036941Retail ModulesWeb POSpublic2017-09-12 12:562017-10-31 09:19
egoitz 
ranjith_qualiantech_com 
normalmajoralways
closedfixed 
5
 
RR17Q2.4RR17Q2.4 
marvintm
No
0036941: Unneeded query executed on the orderloader process
During the orderloader process a query to set one attributeset is executed when there is not stock and the product has an attribute set defined.
It is setting on the new shipment line the same attributesetvalue than in the last one, what has not sense.
-Define a product with an attribute set.
-Create on the terminal a ticket with that prodduct.
-Check that a query on the m_inoutline table is executed.
The query:

https://docs.google.com/document/d/1pWsaB-yj2pzBWU3v9R0nGYNpv4k1iXZXmCw6qGJ_kh0/edit [^]
REview the following code on the orderload process:

[12:48:20] Egoitz: if (!foundStockProposed && orderLine.getProduct().getAttributeSet() != null) {
            // M_GetStock couldn't find any valid stock, and the product has an attribute set. We
            // will
            // attempt to find an old transaction for this product, and get the attribute values
            // from
            // there
            OBCriteria<ShipmentInOutLine> oldLines = OBDal.getInstance().createCriteria(
                ShipmentInOutLine.class);
            oldLines
                .add(Restrictions.eq(ShipmentInOutLine.PROPERTY_PRODUCT, orderLine.getProduct()));
            oldLines.setMaxResults(1);
            oldLines.addOrderBy(ShipmentInOutLine.PROPERTY_CREATIONDATE, false);
            List<ShipmentInOutLine> oldLine = oldLines.list();
            if (oldLine.size() > 0) {
              oldAttributeSetValues = oldLine.get(0).getAttributeSetValue();
            }

          }
No tags attached.
blocks defect 0036840 closed ranjith_qualiantech_com Unneeded query executed on the orderloader process 
Issue History
2017-09-25 11:33marvintmTypedefect => backport
2017-09-25 11:33marvintmTarget Version => RR17Q2.4
2017-09-26 08:15hgbotCheckin
2017-09-26 08:15hgbotNote Added: 0099570
2017-09-26 08:15hgbotStatusscheduled => resolved
2017-09-26 08:15hgbotResolutionopen => fixed
2017-09-26 08:15hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/1aa6dec4e0ad4c1354194ef1796e5d195017920c [^] => http://code.openbravo.com/retail/backports/3.0RR17Q2.4/org.openbravo.retail.posterminal/rev/841b5fd9039d27dc9f9e355380b7fb59fa3af49e [^]
2017-10-31 09:19marvintmStatusresolved => closed
2017-10-31 09:19marvintmFixed in Version => RR17Q2.4

Notes
(0099570)
hgbot   
2017-09-26 08:15   
Repository: retail/backports/3.0RR17Q2.4/org.openbravo.retail.posterminal
Changeset: 841b5fd9039d27dc9f9e355380b7fb59fa3af49e
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Tue Sep 26 11:27:09 2017 +0530
URL: http://code.openbravo.com/retail/backports/3.0RR17Q2.4/org.openbravo.retail.posterminal/rev/841b5fd9039d27dc9f9e355380b7fb59fa3af49e [^]

Fixed issue 36941 : Removed unused logic in OrderLoader

* Following condition is removed, if the stock is not present and product doesn't have attribute set, then attribute set is fetched from last transaction

---
M src/org/openbravo/retail/posterminal/OrderLoader.java
---