Openbravo Issue Tracking System - Modules
View Issue Details
0050249ModulesDistribution Order for Advanced Warehouse Operationspublic2022-09-14 17:102022-10-06 10:35
vmromanos 
AtulOpenbravo 
normalmajoralways
closedfixed 
5
 
 
vmromanos
0050249: Close DO can be launched from two different places, creating problems in Push API
The process of closing a Distribution Order can be launched from two different places:
1. ProcessDistributionOrderUtil.processDistributionOrder()
2. ProcessDistributionOrderUtil.closeDistributionOrders()

The second method was originally private, but it was transformed to public recently.
There are two places that call it now:
2.a. org.openbravo.distributionorder.hooks.implementation.CloseAfterReceiveDistributionOrderHook
2.b. org.openbravo.warehouse.advancedwarehouseoperations.distributionorders.hook.CloseDOIfSkipDeltaTaskGroup


#1 calls #2, and also launches some push api events afterwards, which works fine.

However, the events associated to #2.a. and #2.b. are never launched if the distribution order is closed by calling #2.

It is better to have just one point to process distribution orders, so any related hook works as expected.


Not needed
Make #2 private. This is an API change, but nobody else apart from us should be using it, so it is safe.

Modify #2.a. and #2.b. to call #1 instead. This way we centralize this process in just one place.
No tags attached.
related to design defect 0050421 new Triage Platform Base Openbravo ERP Push API payload generation when event is triggered 
caused by feature request 0049412 closed Triage Omni WMS Openbravo ERP AWO, Close DO automatically when Skip Delta 
related to defect 0052741 closed Triage Omni WMS Modules DO API - Update Distribution Order status event is not triggered when a document change the status from confirm to close 
Issue History
2022-09-14 17:10vmromanosNew Issue
2022-09-14 17:10vmromanosAssigned To => Triage Omni OMS
2022-09-14 17:10vmromanosNote Added: 0141113
2022-09-14 17:12vmromanosNote Edited: 0141113bug_revision_view_page.php?bugnote_id=0141113#r24766
2022-09-14 17:23aferrazAssigned ToTriage Omni OMS => Triage Omni WMS
2022-09-14 17:39AtulOpenbravoStatusnew => scheduled
2022-09-14 17:39AtulOpenbravoAssigned ToTriage Omni WMS => AtulOpenbravo
2022-09-14 17:50vmromanosRelationship addedcaused by 0049412
2022-09-14 18:40hgbotNote Added: 0141123
2022-09-14 18:40hgbotNote Added: 0141124
2022-10-05 14:27vmromanosRelationship addedrelated to 0050421
2022-10-05 15:17hgbotResolutionopen => fixed
2022-10-05 15:17hgbotStatusscheduled => resolved
2022-10-05 15:17hgbotNote Added: 0141685
2022-10-05 15:17hgbotNote Added: 0141686
2022-10-05 15:18hgbotNote Added: 0141687
2022-10-05 15:18hgbotNote Added: 0141688
2022-10-05 15:18vmromanosReview Assigned To => vmromanos
2022-10-05 15:18vmromanosStatusresolved => closed
2022-10-06 10:35hgbotNote Added: 0141720
2023-06-16 16:24AtulOpenbravoRelationship addedrelated to 0052741

Notes
(0141113)
vmromanos   
2022-09-14 17:10   
(edited on: 2022-09-14 17:12)
Related to https://openbravo.atlassian.net/browse/RM-1862 [^]

Please make sure the flow explained there works fine after the fix

(0141123)
hgbot   
2022-09-14 18:40   
Merge Request created: https://gitlab.com/openbravo/product/mods/org.openbravo.distributionorder/-/merge_requests/18 [^]
(0141124)
hgbot   
2022-09-14 18:40   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.warehouse.advancedwarehouseoperations.distributionorders/-/merge_requests/13 [^]
(0141685)
hgbot   
2022-10-05 15:17   
Repository: https://gitlab.com/openbravo/product/mods/org.openbravo.distributionorder [^]
Changeset: bd167807234779b4ee26e6e0a04ec8ba15b6f182
Author: Atul Gaware <atul.gaware@openbravo.com>
Date: 05-10-2022 13:17:52
URL: https://gitlab.com/openbravo/product/mods/org.openbravo.distributionorder/-/commit/bd167807234779b4ee26e6e0a04ec8ba15b6f182 [^]

Fixed BUG-0050249: Close DO can be launched from two different places, creating problems in Push API

**Make closeDistributionOrders method private so that it
cannot be called from other places.
**Avoid call to closeDistributionOrders instead call
processDistributionOrder to centralize process DO from one
place.

---
M src/org/openbravo/distributionorder/erpCommon/utility/ProcessDistributionOrderUtil.java
M src/org/openbravo/distributionorder/hooks/implementation/CloseAfterReceiveDistributionOrderHook.java
---
(0141686)
hgbot   
2022-10-05 15:17   
Merge request merged: https://gitlab.com/openbravo/product/mods/org.openbravo.distributionorder/-/merge_requests/18 [^]
(0141687)
hgbot   
2022-10-05 15:18   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.warehouse.advancedwarehouseoperations.distributionorders [^]
Changeset: 029bdba1ef89c3b0cb541140b17b6ad6f9581e59
Author: Atul Gaware <atul.gaware@openbravo.com>
Date: 05-10-2022 06:47:20
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.warehouse.advancedwarehouseoperations.distributionorders/-/commit/029bdba1ef89c3b0cb541140b17b6ad6f9581e59 [^]

Related to BUG-0050249: Close DO can be launched from two
different places, creating problems in Push API

**Avoid call to closeDistributionOrders instead call
processDistributionOrder to centralize process DO from one
place

---
M src/org/openbravo/warehouse/advancedwarehouseoperations/distributionorders/hook/CloseDOIfSkipDeltaTaskGroup.java
---
(0141688)
hgbot   
2022-10-05 15:18   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.warehouse.advancedwarehouseoperations.distributionorders/-/merge_requests/13 [^]
(0141720)
hgbot   
2022-10-06 10:35   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.warehouse.advancedwarehouseoperations.distributionorders [^]
Changeset: 8eb12d5f04961105f72344a89cb249ba4995fb8b
Author: Víctor Martínez Romanos <victor.martinez@openbravo.com>
Date: 06-10-2022 10:33:03
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.warehouse.advancedwarehouseoperations.distributionorders/-/commit/8eb12d5f04961105f72344a89cb249ba4995fb8b [^]

Related to ISSUE-50249 Related to ISSUE-49412: delete tasks hook not working

Bug caught by the JUnit tests:
org.openbravo.warehouse.advancedwarehouseoperations.distributionorders.test.OBDOWithAWOTests.DOAWO040_SkipDelta
org.openbravo.warehouse.advancedwarehouseoperations.distributionorders.test.OBDOWithAWOTests.DOAWO060_SkipDelta_Default

When confirming a DO with skip delta and the OBDOA_Close_DOI_After_Skip_Delta or
the OBDOA_Close_DOR_After_Skip_Delta preferences are set, the system closes the
DO.

Before the 0050249 fix, the AfterDistributionOrderProcessedHook were not executed
for the 0049412 flow, therefore the AfterDOAWOProcessedHook class was not executed
either, which was wrong.

After the 0050249 fix, the class AfterDOAWOProcessedHook is executed. However, this class
had a bug were it was not possible to delete an assigned task.

The fix refreshes the task (only if necessary) to get an updated version without the assignee
and it adds some useful comments to understand the technical solution approach.

---
M src/org/openbravo/warehouse/advancedwarehouseoperations/distributionorders/hook/AfterDOAWOProcessedHook.java
---