Openbravo Issue Tracking System - Retail Modules
View Issue Details
0048386Retail ModulesCash uppublic2022-01-12 11:332022-02-16 08:54
ludmila_ursu 
ranjith_qualiantech_com 
highmajorhave not tried
closedfixed 
5
RR20Q3.4 
 
No
0048386: A cancel and replace order causes an EWI
After doing one sale, customer_1 wanted to cancel and replace the first order (the replace was a new order, for 0.01 E).
This cancel and replace order provoked an EWI in the backoffice:
Caused by: org.openbravo.base.exception.OBException: A different object with the same identifier value was already associated with the session : [Order#30F63F17B28CB0ED25D412E32164F01D]
    at org.openbravo.erpCommon.businessUtility.ReplaceOrderExecutor.cancelAndReplaceOrder(ReplaceOrderExecutor.java:167)

The same error was experienced by customer_2 (ZenDesk ticket 23027).
The fix that was applied was this one:
https://gitlab.com/obcustomers/ZOD/openbravo-20q1/-/commit/c88ebddf7c56b0d3db7039591196fe4281f63013 [^]
This corrected the error.

For customer_1, the service team applied the same fix.
At the present moment, the EWI is solved. We are not certain if correction was OK, because of applying the fix, or because of restarting the server (during deployment).
But since the defect seems to be present in the core of Openbravo, can you please check, if the fix mentioned, must be also applied to other customers ?

Thank you for your help.
I remain available if needed.

Steps to reproduce:
The steps are:

1. Make a sales.

2. Make a Cancel & Replace of the sales that you did in the step 1.

3. Check that the first order was canceled with the second that you do in step 2.
Proposed solution

Apply this fix:
https://gitlab.com/obcustomers/ZOD/openbravo-20q1/-/commit/c88ebddf7c56b0d3db7039591196fe4281f63013 [^]
No tags attached.
Issue History
2022-01-12 11:33ludmila_ursuNew Issue
2022-01-12 11:33ludmila_ursuAssigned To => Retail
2022-01-12 11:33ludmila_ursuTriggers an Emergency Pack => No
2022-02-02 17:09ranjith_qualiantech_comAssigned ToRetail => ranjith_qualiantech_com
2022-02-04 06:57hgbotNote Added: 0134778
2022-02-04 06:57ranjith_qualiantech_comStatusnew => scheduled
2022-02-14 16:29ludmila_ursuDescription Updatedbug_revision_view_page.php?rev_id=23663#r23663
2022-02-16 08:54hgbotResolutionopen => fixed
2022-02-16 08:54hgbotStatusscheduled => closed
2022-02-16 08:54hgbotNote Added: 0135044
2022-02-16 08:54hgbotFixed in Version => PR22Q2
2022-02-16 08:54hgbotNote Added: 0135045

Notes
(0134778)
hgbot   
2022-02-04 06:57   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/523 [^]
(0135044)
hgbot   
2022-02-16 08:54   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/523 [^]
(0135045)
hgbot   
2022-02-16 08:54   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 48c4b8ab934044bd4d3efd6c951cd71c561c454d
Author: Ranjith S R <ranjith@qualiantech.com>
Date: 16-02-2022 07:54:27
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/48c4b8ab934044bd4d3efd6c951cd71c561c454d [^]

Fixed ISSUE-48386: Refresh Order before completing when doing Cancel & Replace
Sometimes, inverse order is created with same identifier. To avoid this, Order should be refreshed

---
M src/org/openbravo/erpCommon/businessUtility/ReplaceOrderExecutor.java
---