Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0053273
TypeCategorySeverityReproducibilityDate SubmittedLast Update
feature request[Modules] Distribution Ordersminoralways2023-08-23 09:462023-08-23 19:35
ReporterdmiguelezView Statuspublic 
Assigned ToAtulOpenbravo 
PrioritynormalResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Regression date
Regression introduced by commit
Regression level
Review Assigned To
Regression introduced in release
Summary

0053273: Improve the error message in the DO import API

DescriptionWhen importing a an existing DO through the API with lines that is not in draft status it fails correctly, but the error message does not give information about the document number and line number. It is important because several documents can be imported in a batch.
Steps To ReproduceImport a DO trough the API using the provided json.
Import it a second time, then it fails with this error message: "Error while importing an item: Not possible to add new lines to an existing document!!!" and should be "Error while importing an item: Not possible to add new lines to an existing document!!! DocumentNo: 9999999999"

[
  {
    "documentNo": "9999999999",
    "organization": "US",
    "isIssue": false,
    "warehouseIssue": "WC",
    "warehouseReceipt": "EC",
    "orderDate": "2022-06-05",
    "scheduledDeliveryDate": "2022-06-10",
    "lines": [
      {
        "product": "CH_CAMEMBERT_CHEESE",
        "operativeQuantity": 2,
        "qtyIssued": 2,
        "qtyReceived": 2
      },
      {
        "product": "CH_MANCHEGO_CHEESE",
        "operativeQuantity": 1,
        "qtyIssued": 1,
        "qtyReceived": 1
      }
    ]
  }
]


How to import:
As AWO QA Admin client, enable the Web Services for AWO QA Admin Role in the role window and use the swagger URL to import the previous data.
Proposed Solutiondiff --git a/src/org/openbravo/distributionorder/api/hook/distributionorderline/ImportDOLineBaseOBObjectFetcher.java b/src/org/openbravo/distributionorder/api/hook/distributionorderline/ImportDOLineBaseOBObjectFetcher.java
index 10eec75..cfcef47 100644
--- a/src/org/openbravo/distributionorder/api/hook/distributionorderline/ImportDOLineBaseOBObjectFetcher.java
+++ b/src/org/openbravo/distributionorder/api/hook/distributionorderline/ImportDOLineBaseOBObjectFetcher.java
@@ -79,7 +79,11 @@ public class ImportDOLineBaseOBObjectFetcher implements ImportedBaseOBObjectFetc
       }
       if (distOrderLine == null
           && !distOrd.getDocumentStatus().equalsIgnoreCase(ImportDOUtils.DRAFT_STATUS)) {
- throw new OBException("Not possible to add new lines to an existing document!!!");
+ throw new OBException(String.format(
+ "Not possible to add new lines to an existing document!!! DocumentNo: %s and LineNo: %s",
+ distOrd.getDocumentNo(),
+ properties.containsKey("lineNo") ? (String) properties.get("lineNo")
+ : "has not been provided in the import data"));
       }
       return (T) distOrderLine;
     } else {
TagsNo tags attached.
Attached Filespng file icon screenshot of developed.png [^] (135,502 bytes) 2023-08-23 19:35

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0153856)
hgbot (developer)
2023-08-23 17:47

Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.distributionorder.api/-/merge_requests/22 [^]
(0153857)
hgbot (developer)
2023-08-23 19:35

Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.distributionorder.api [^]
Changeset: 81cc5ca905320e079a8663e1a147041f2c0ef81a
Author: Atul Gaware <atul.gaware@openbravo.com>
Date: 23-08-2023 17:35:00
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.distributionorder.api/-/commit/81cc5ca905320e079a8663e1a147041f2c0ef81a [^]

Fixes BUG-0053273: Improve the error message in the DO import API

---
M src/org/openbravo/distributionorder/api/hook/distributionorderline/ImportDOLineBaseOBObjectFetcher.java
---
(0153858)
hgbot (developer)
2023-08-23 19:35

Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.distributionorder.api/-/merge_requests/22 [^]

- Issue History
Date Modified Username Field Change
2023-08-23 09:46 dmiguelez New Issue
2023-08-23 09:46 dmiguelez Assigned To => Triage Omni WMS
2023-08-23 09:46 dmiguelez Proposed Solution updated
2023-08-23 13:02 mtaal Assigned To Triage Omni WMS => AtulOpenbravo
2023-08-23 13:05 AtulOpenbravo Status new => scheduled
2023-08-23 17:47 hgbot Note Added: 0153856
2023-08-23 19:35 hgbot Resolution open => fixed
2023-08-23 19:35 hgbot Status scheduled => closed
2023-08-23 19:35 hgbot Note Added: 0153857
2023-08-23 19:35 hgbot Note Added: 0153858
2023-08-23 19:35 mtaal File Added: screenshot of developed.png


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker