Openbravo Issue Tracking System - Modules
View Issue Details
0051442ModulesOpenbravo Business APIpublic2023-01-23 13:382023-01-26 09:13
jorge-garcia 
jorge-garcia 
normalmajorsometimes
closedfixed 
5
 
 
0051442: Throw better error messages when importing a physical inventory through the API
As of now, if a "/ws/org.openbravo.api.ImportService/Inventory" request fails for any reason, this message is shown:

"Error while importing an item: null"

It is required to improve this message to indicate what is the actual error that occurs during the import process.
1) Use this JSON body in Postman for "{{base_url}}/ws/org.openbravo.api.ImportService/Inventory" POST request:
  [
    {
      "client": "The White Valley Group",
      "organization": "Vall Blanca Store",
      "warehouse": "VBS/001",
      "date": "2022-04-21",
      "name": "2022-04-21",
      "description": "2022-04-21",
      "lines": [
        {
          "bin": "VBS/001 0-0-0",
          "product": "cacatua",
          "qty": 70,
          "uOM": "Unit"
        },
        {
          "bin": "VBS/001 0-0-0",
          "product": "WVG/B0017",
          "qty": 10,
          "uOM": "Unit"
        }
      ]
    }
  ]
2) Login in the ERP
3) Navigate to EDL Request
4) Search for last record created in error status
5) In Request Line, verify Error Message is "Error while importing an item: null" (this is wrong)
No tags attached.
has duplicate feature request 0051037 new Triage Platform Conn Retail Modules inventory Import API V2: improved error handling 
Issue History
2023-01-23 13:38jorge-garciaNew Issue
2023-01-23 13:38jorge-garciaAssigned To => jorge-garcia
2023-01-23 13:40jorge-garciaNote Added: 0145750
2023-01-23 13:40jorge-garciaSummaryRM2362 Throw better error messages when importing a physical inventory through the API => Throw better error messages when importing a physical inventory through the API
2023-01-23 13:42jorge-garciaStatusnew => scheduled
2023-01-23 14:39hgbotNote Added: 0145764
2023-01-24 13:21rafarodaRelationship addedhas duplicate 0051037
2023-01-25 14:59hgbotNote Added: 0145838
2023-01-26 08:29hgbotResolutionopen => fixed
2023-01-26 08:29hgbotStatusscheduled => closed
2023-01-26 08:29hgbotNote Added: 0145849
2023-01-26 08:29hgbotNote Added: 0145850
2023-01-26 09:13hgbotNote Added: 0145852
2023-01-26 09:13hgbotNote Added: 0145853

Notes
(0145750)
jorge-garcia   
2023-01-23 13:40   
JIRA issue RM-2362[1]

[1]https://openbravo.atlassian.net/browse/RM-2362 [^]
(0145764)
hgbot   
2023-01-23 14:39   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.api/-/merge_requests/120 [^]
(0145838)
hgbot   
2023-01-25 14:59   
Merge Request created: https://gitlab.com/openbravo/ci/modules/org.openbravo.api.tests/-/merge_requests/32 [^]
(0145849)
hgbot   
2023-01-26 08:29   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.api [^]
Changeset: 7ed6566d30ee0d59f7a0ec074a0ec513517f3e90
Author: Jorge García <jorge.garcia@openbravo.com>
Date: 26-01-2023 07:29:49
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.api/-/commit/7ed6566d30ee0d59f7a0ec074a0ec513517f3e90 [^]

Fixes BUG-51442: Real exception is hidden when some Inventory import java mappings fail

---
M src/org/openbravo/api/mappings/inventoryline/ImportInventoryLineJavaPropertyMappingHandler.java
---
(0145850)
hgbot   
2023-01-26 08:29   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.api/-/merge_requests/120 [^]
(0145852)
hgbot   
2023-01-26 09:13   
Repository: https://gitlab.com/openbravo/ci/modules/org.openbravo.api.tests [^]
Changeset: 22c7d270c7753f93e66deffc6ed824d4c44a84df
Author: Jorge García <jorge.garcia@openbravo.com>
Date: 26-01-2023 08:13:20
URL: https://gitlab.com/openbravo/ci/modules/org.openbravo.api.tests/-/commit/22c7d270c7753f93e66deffc6ed824d4c44a84df [^]

Related to ISSUE-51442: Add tests to verify handled exceptions for inventory import

---
A src-test/data/importer/InventoryMissingBin.json
A src-test/data/importer/InventoryMissingProduct.json
M src-test/org/openbravo/api/tests/importer/ApiImportMappingBaseTest.java
M src-test/org/openbravo/api/tests/importer/ImportInventory.java
---
(0145853)
hgbot   
2023-01-26 09:13   
Merge request merged: https://gitlab.com/openbravo/ci/modules/org.openbravo.api.tests/-/merge_requests/32 [^]