Openbravo Issue Tracking System - Modules
View Issue Details
0053935ModulesOpenbravo Business APIpublic2023-11-15 03:492024-01-04 12:44
ivazquez 
Rajesh_18 
highmajoralways
closedfixed 
5
 
 
0053935: Update UOM product
When to use the Product API with the following endpoint:

http://localhost:8080/openbravo/ws/org.openbravo.api.ImportService/Product [^]

In the alternativeUnitOfMeasure field some of the fields "sales", "purchase", and "logistics" are set as "P" of primary and there is already a UOM with some of these fields in the back office, because of the Event Handler ProductAumEventHandler.java, the EDL Request will be in error.

The API should delete the UOM that is not defined in the JSON that is sent in the request and add the new UOM.
Verify in the back office a product where in the "Alternate UOM" tab there is one that contains a field such as "primary".

Build the JSON to update this Product and inside and in the field "alternativeUnitOfMeasure" add a UOM setting in the same field as the one in the product tab as "P":

"alternativeUnitOfMeasure": [
  {
    "sales": "S",
    "purchase": "P",
    "logistics": "P",
    "uom": "PCB_25",
    "conversionRate": 25
  }
]

Perform the request and verify that the EDL Request failed with the following message: Error while importing an item: Duplicate PRIMARY Alternate Unit of Measure in Logistics for this product.
No tags attached.
related to defect 0055778 closed sreehari Retail Modules Update Alternative UOM Product 
patch 22Q4_53935_retailApi.patch (6,165) 2024-01-04 12:44
https://issues.openbravo.com/file_download.php?file_id=19282&type=bug
Issue History
2023-11-15 03:49ivazquezNew Issue
2023-11-15 03:49ivazquezAssigned To => Triage Platform Conn
2023-11-16 09:26adrianromeroAssigned ToTriage Platform Conn => Retail
2023-12-06 14:12Rajesh_18Assigned ToRetail => Rajesh_18
2023-12-06 14:12Rajesh_18Statusnew => scheduled
2023-12-11 09:29hgbotNote Added: 0158030
2023-12-19 08:26hgbotResolutionopen => fixed
2023-12-19 08:26hgbotStatusscheduled => closed
2023-12-19 08:26hgbotNote Added: 0158319
2023-12-19 08:26hgbotNote Added: 0158320
2024-01-04 12:44ivazquezFile Added: 22Q4_53935_retailApi.patch
2024-06-14 19:37ivazquezRelationship addedblocks 0055778
2024-06-14 19:37ivazquezRelationship deletedblocks 0055778
2024-06-14 19:38ivazquezRelationship addedrelated to 0055778

Notes
(0158030)
hgbot   
2023-12-11 09:29   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.api/-/merge_requests/82 [^]
(0158319)
hgbot   
2023-12-19 08:26   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.api [^]
Changeset: 937e9421dfcaa3090dd4cecd52a009dca89f2551
Author: Rajesh Senthilkumar <rajesh@qualiantech.com>
Date: 19-12-2023 08:23:52
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.api/-/commit/937e9421dfcaa3090dd4cecd52a009dca89f2551 [^]

Fixed ISSUE-53935 Updated Product API to verify alternate UOM
    * If Json of alternativeUnitOfMeasure has primary in sales or purchase or logistics. The existing alternative UOM for the product is checked. If existing has Primary. It is changed to secondary.
    * If Json of alternativeUnitOfMeasure has many object. If primary for sales or purchase or logistics > 1. Exception is thrown.
    * If alternativeUnitOfMeasure name not present in DB Exception is thrown.
    * Documentation added for alternativeUnitOfMeasure.

---
M src/org/openbravo/retail/api/mappings/product/RetailApiImportProductJavaPropertyMappingHandler.java
---
(0158320)
hgbot   
2023-12-19 08:26   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.api/-/merge_requests/82 [^]