Openbravo Issue Tracking System - Modules
View Issue Details
0057652ModulesAdvanced Warehouse Operationspublic2025-01-15 17:242025-02-13 09:47
malsasua 
ludmila_ursu 
highmajoralways
closedfixed 
5
 
 
merged
AtulOpenbravo
115006
Gold
0057652: Push API is sending DO in Ongoing status
When a distribution order is created and completed from AWO app, an EDL Request is created using the event OBDOAPI_UpdateDOStatus , but sometimes, the record is sent in status OnGoing

It should not be possible because the DO are created in OnGoing status directly in the Frontend.

Analyzing the code, we have seen the event only is triggered when the DO is processed, but we have some cases that the json sent from EDL Request contains docStatus=OnGoing
. it happens randomly
No tags attached.
related to backport 0057969 closed ludmila_ursu Push API is sending DO in Ongoing status 
? proof of testing ISSUE-57652.webm (4,194,488) 2025-01-23 20:26
https://issues.openbravo.com/file_download.php?file_id=20789&type=bug
Issue History
2025-01-15 17:24malsasuaNew Issue
2025-01-15 17:24malsasuaAssigned To => Triage Omni WMS
2025-01-15 17:24malsasuaSupport ticket => 115006
2025-01-15 17:24malsasuaOBNetwork customer => Gold
2025-01-15 17:27vmromanosDescription Updatedbug_revision_view_page.php?rev_id=29056#r29056
2025-01-15 17:37vmromanosNote Added: 0174198
2025-01-20 10:52mtaalAssigned ToTriage Omni WMS => AtulOpenbravo
2025-01-21 14:43AtulOpenbravoAssigned ToAtulOpenbravo => ludmila_ursu
2025-01-21 14:44hgbotMerge Request Status => open
2025-01-21 14:44hgbotNote Added: 0174473
2025-01-23 20:25ludmila_ursuNote Added: 0174631
2025-01-23 20:26ludmila_ursuFile Added: proof of testing ISSUE-57652.webm
2025-01-24 12:15hgbotResolutionopen => fixed
2025-01-24 12:15hgbotStatusnew => resolved
2025-01-24 12:15hgbotNote Added: 0174674
2025-01-24 12:15hgbotMerge Request Statusopen => merged
2025-01-24 12:15hgbotNote Added: 0174675
2025-01-24 12:15AtulOpenbravoReview Assigned To => AtulOpenbravo
2025-01-24 12:15AtulOpenbravoStatusresolved => closed
2025-02-11 10:12hgbotStatusclosed => resolved
2025-02-11 10:12hgbotNote Added: 0175468
2025-02-11 10:12AtulOpenbravoStatusresolved => closed
2025-02-13 09:47AtulOpenbravoIssue cloned0057969
2025-02-13 09:47AtulOpenbravoRelationship addedrelated to 0057969

Notes
(0174198)
vmromanos   
2025-01-15 17:37   
@Developer:

In theory the launch of this event is centralized in the UpdateDOStatusEvent AfterDistributionOrderProcessedHook class, which is executed only after processing the DO (and therefore changing its status). See ProcessDistributionOrderUtil.processDistributionOrder()

The ongoing status is not changed through this method, but instead the DO is synchronized directly with the Ongoing status. In theory this event shouldn't be launched for a DO in that status.

After a quick view to the code I don't find the root cause. My first idea was related to the asynchronous nature of the push API events. But this shouldn't be a problem in this concrete case because the DO sent is in ongoing status, which shouldn't be possible from the application as explained above.
The only possibility I see is that someone has changed the status back to ongoing after processing the DO, which is something impossible from the UI, and very weird from the user perspective.


Because of that my recommendation would be to add log in the UpdateDOStatusEvent to print the stack trace and the DO information when we detect the DOi is in ongoing status to try to understand the root cause if we are unable to reproduce it ourselves.
(0174473)
hgbot   
2025-01-21 14:44   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.distributionorder.api/-/merge_requests/42 [^]
(0174631)
ludmila_ursu   
2025-01-23 20:25   
Proof of testing
https://docs.google.com/spreadsheets/d/1G7kKu_zsRR5yhmO-VRlZkhS4_V74SaH-gKrpPUorkq8/edit?gid=0#gid=0 [^]
(0174674)
hgbot   
2025-01-24 12:15   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.distributionorder.api [^]
Changeset: 2466b5b990fcbba8a7c0eb02d61682def822d1d0
Author: Atul Gaware <atul.gaware@openbravo.com>
Date: 23-01-2025 16:55:52
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.distributionorder.api/-/commit/2466b5b990fcbba8a7c0eb02d61682def822d1d0 [^]

Fixes ISSUE-0057652: Push API is sending DO in Ongoing status

**Add stack trace in case distribution order has ONGOING status
when triggering UpdateDOStatus event to get more information

---
M src/org/openbravo/distributionorder/api/push/UpdateDOStatusEvent.java
---
(0174675)
hgbot   
2025-01-24 12:15   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.distributionorder.api/-/merge_requests/42 [^]
(0175468)
hgbot   
2025-02-11 10:12   
Repository: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.distributionorder.api [^]
Changeset: ef9b6f2864c28405c8210f6064046f623e014c4e
Author: Atul Gaware <atul.gaware@openbravo.com>
Date: 10-02-2025 00:25:09
URL: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.distributionorder.api/-/commit/ef9b6f2864c28405c8210f6064046f623e014c4e [^]

Fixes ISSUE-0057652: Push API is sending DO in Ongoing status

**Add stack trace in case distribution order has ONGOING status
when triggering UpdateDOStatus event to get more information

---
M src/org/openbravo/distributionorder/api/push/UpdateDOStatusEvent.java
---