Openbravo Issue Tracking System - Modules | |||||||||||||||||||
View Issue Details | |||||||||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||||||||
0057879 | Modules | Openbravo Business API | public | 2025-02-05 15:33 | 2025-02-10 10:16 | ||||||||||||||
Reporter | alostale | ||||||||||||||||||
Assigned To | Triage Platform Conn | ||||||||||||||||||
Priority | normal | Severity | major | Reproducibility | have not tried | ||||||||||||||
Status | closed | Resolution | fixed | ||||||||||||||||
Platform | OS | 5 | OS Version | ||||||||||||||||
Product Version | |||||||||||||||||||
Target Version | Fixed in Version | ||||||||||||||||||
Merge Request Status | |||||||||||||||||||
Regression date | |||||||||||||||||||
Regression introduced by commit | |||||||||||||||||||
Regression level | |||||||||||||||||||
Review Assigned To | |||||||||||||||||||
Support ticket | |||||||||||||||||||
OBNetwork customer | |||||||||||||||||||
Regression introduced in release | |||||||||||||||||||
Summary | 0057879: values not validated on API import | ||||||||||||||||||
Description | When importing objects through API, values are not validated with their Application Dictionary definition. For example, values stored in a list reference property are not checked they are part of the available set of values for that reference. | ||||||||||||||||||
Steps To Reproduce | Using Postman examples collection [1]: 1. Look for Masterdata > Import Business Partner request 2. Change the value of the invoiceTerms property to something invalid (ie. XXX) 3. Execute the request ERROR: Check the Business Partner is successfully imported with an invalid invoice term value. It should have failed with an error message saying XXX is not a valid value for invoiceTerms. --- [1] https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.api/-/blob/master/examples/Openbravo%20API.postman_collection.json?ref_type=heads [^] | ||||||||||||||||||
Proposed Solution | The problem is caused by how values are set in BaseOBObjects (ie. in DirectPropertyMapping [1], but also applicable to other mappings) using the setValue method instead of the set one. According to the documentation [2] setValue skips validations: * Sets a value in the object without any security or validation checking. Should be used with * care. Is used by the subclasses and system classes. [1] https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.service.external.integration/-/blob/7f20dbeb867531f404546aae5a8f4e70a719389f/src/org/openbravo/service/external/integration/mapping/DirectPropertyMapping.java#L150 [^] [2] https://gitlab.com/orisha-group/bu-commerce/openbravo/product/openbravo/-/blob/8fbb1539927d54510869b0740b8168f69ce69424/src/org/openbravo/base/structure/BaseOBObject.java#L299 [^] | ||||||||||||||||||
Additional Information | |||||||||||||||||||
Tags | No tags attached. | ||||||||||||||||||
Relationships |
| ||||||||||||||||||
Attached Files | |||||||||||||||||||
Issue History | |||||||||||||||||||
Date Modified | Username | Field | Change | ||||||||||||||||
2025-02-05 15:33 | alostale | New Issue | |||||||||||||||||
2025-02-05 15:33 | alostale | Assigned To | => Triage Platform Conn | ||||||||||||||||
2025-02-05 15:43 | alostale | Proposed Solution updated | |||||||||||||||||
2025-02-06 14:29 | hgbot | Note Added: 0175224 | |||||||||||||||||
2025-02-10 09:33 | alostale | Status | new => scheduled | ||||||||||||||||
2025-02-10 09:35 | alostale | Issue cloned | 0057918 | ||||||||||||||||
2025-02-10 09:35 | alostale | Relationship added | depends on 0057918 | ||||||||||||||||
2025-02-10 09:36 | alostale | Issue cloned | 0057919 | ||||||||||||||||
2025-02-10 09:37 | alostale | Relationship added | depends on 0057919 | ||||||||||||||||
2025-02-10 10:16 | hgbot | Note Added: 0175377 | |||||||||||||||||
2025-02-10 10:16 | hgbot | Resolution | open => fixed | ||||||||||||||||
2025-02-10 10:16 | hgbot | Status | scheduled => closed | ||||||||||||||||
2025-02-10 10:16 | hgbot | Note Added: 0175378 |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|