Openbravo Issue Tracking System - Retail Modules
View Issue Details
0046864Retail ModulesWeb POSpublic2021-05-27 12:502021-06-02 09:46
nicola_uva 
rqueralta 
highmajoralways
closedfixed 
5
pi 
RR21Q3 
pi
No
0046864: SafeBox - NonUniqueResultException happen when is finalize the count safe box
In org.openbravo.retail.posterminal.ProcessCountSafeBox when is found the safebox missing the organization filter in the below query.

  OBCriteria<OBPOSSafeBox> safeBoxCriteria = OBDal.getInstance()
        .createCriteria(OBPOSSafeBox.class);
    safeBoxCriteria.add(
        Restrictions.eq(OBPOSSafeBox.PROPERTY_SEARCHKEY, jsonCountSafeBox.getString("safeBox")));
    OBPOSSafeBox safebox = (OBPOSSafeBox) safeBoxCriteria.uniqueResult();
1)Go in the erp
2)open the window safe box
3)configure two safe boxes with same searchkey and different organization
4)Login in the pos
5)Do the count safe box action and finalize it
6)Check the error in openbravo.log

Below the error
An error happened when processing a record:
org.hibernate.NonUniqueResultException: query did not return a unique result: 2
Add to the query the organization filter
No tags attached.
Issue History
2021-05-27 12:50nicola_uvaNew Issue
2021-05-27 12:50nicola_uvaAssigned To => Retail
2021-05-27 12:50nicola_uvaResolution time => 1622412000
2021-05-27 12:50nicola_uvaRegression introduced in release => pi
2021-05-27 12:50nicola_uvaTriggers an Emergency Pack => No
2021-05-27 12:53nicola_uvaResolution time1622412000 => 1622844000
2021-05-27 12:53nicola_uvaPrioritynormal => high
2021-05-27 12:53nicola_uvaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=22612#r22612
2021-05-27 12:54nicola_uvaSeverityminor => major
2021-05-28 18:22rqueraltaAssigned ToRetail => rqueralta
2021-06-01 16:34hgbotNote Added: 0128875
2021-06-02 09:46hgbotResolutionopen => fixed
2021-06-02 09:46hgbotStatusnew => closed
2021-06-02 09:46hgbotNote Added: 0128926
2021-06-02 09:46hgbotFixed in Version => RR21Q3
2021-06-02 09:46hgbotNote Added: 0128927

Notes
(0128875)
hgbot   
2021-06-01 16:34   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/447 [^]
(0128926)
hgbot   
2021-06-02 09:46   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/447 [^]
(0128927)
hgbot   
2021-06-02 09:46   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal [^]
Changeset: 140ef8dcdbe463be95c36c84c2ca4399d613541c
Author: Rafael Queralta <rafaelcuba81@gmail.com>
Date: 2021-06-02T07:46:37+00:00
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/commit/140ef8dcdbe463be95c36c84c2ca4399d613541c [^]

Fixed BUG-46864: Filtered by safe box organization

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