Openbravo Issue Tracking System - Retail Modules
View Issue Details
0033583Retail ModulesWeb POSpublic2016-08-01 18:542018-02-28 17:55
shuehner 
Sandrahuguet 
normalminorhave not tried
closedfixed 
5
 
RR18Q2 
marvintm
No
0033583: OrderLoader does double query for ad_user related to a bp
OrderLoader does double query in this code here to first check -> are any related contacts + then query again to find the first contact in the list.

Should be optimized to do a single query only to cover both topics

    if (!bp.getADUserList().isEmpty()) {
      String userHqlWhereClause = " usr where usr.businessPartner = :bp and usr.organization.id in (:orgs) order by username";
      OBQuery<User> queryUser = OBDal.getInstance().createQuery(User.class, userHqlWhereClause);

Trace queries done by that part of the code in OrderLoader.java

Rewrite to not use 2 queries.

I.e. only use 2nd query.
Performance
Issue History
2016-08-01 18:54shuehnerNew Issue
2016-08-01 18:54shuehnerAssigned To => Retail
2016-08-01 18:54shuehnerTriggers an Emergency Pack => No
2016-08-01 18:54shuehnerTag Attached: Performance
2018-02-07 13:20SandrahuguetAssigned ToRetail => Sandrahuguet
2018-02-28 08:31SandrahuguetReview Assigned To => marvintm
2018-02-28 08:42hgbotCheckin
2018-02-28 08:42hgbotNote Added: 0102862
2018-02-28 08:42hgbotStatusnew => resolved
2018-02-28 08:42hgbotResolutionopen => fixed
2018-02-28 08:42hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/dba7db40d9b1056a066deec5be60fe31028dc83f [^]
2018-02-28 17:55marvintmStatusresolved => closed
2018-02-28 17:55marvintmFixed in Version => RR18Q2

Notes
(0102862)
hgbot   
2018-02-28 08:42   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: dba7db40d9b1056a066deec5be60fe31028dc83f
Author: Sandra Huguet <sandra.huguet <at> openbravo.com>
Date: Wed Feb 07 13:21:09 2018 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/dba7db40d9b1056a066deec5be60fe31028dc83f [^]

Fixed issue 33583 is not necessary to check related contacts

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