Openbravo Issue Tracking System - Retail Modules
View Issue Details
0056778Retail ModulesRetail APIpublic2024-10-14 18:012024-10-29 10:43
kchoperena 
Bimla_vm 
highmajoralways
closedfixed 
5
 
 
approved
OBPS
No
0056778: Export Promotion API: incompatibleDiscount is defined as mandatory but in the back-end you can create a register not setting it
If you create a register for the Incompatible Discounts tab of 'Promotion and Discounts' window and you leave empty the 'Incompatible discount' field, any GET API is going to fail with the following error as the field has not a value defined:

2024-10-14 17:54:56,174 [http-nio-8080-exec-6] ERROR org.openbravo.service.web.BaseWebServiceServlet - Value of property incompatibleDiscount is null but it does not accept null values
org.openbravo.base.exception.OBException: Value of property incompatibleDiscount is null but it does not accept null values
    at org.openbravo.service.external.integration.mapping.PropertyMapping.addPropertyValueIfValid(PropertyMapping.java:108) ~[classes/:?]
    at org.openbravo.service.external.integration.mapping.PropertyMapping.addMappingValue(PropertyMapping.java:87) ~[classes/:?]
    at org.openbravo.service.external.integration.mapping.PropertyMapper.createSynchronizableBusinessObject(PropertyMapper.java:155) ~[classes/:?]
    at org.openbravo.service.external.integration.export.SynchronizableBusinessObjectExporter.exportToSynchronizableBusinessObject(SynchronizableBusinessObjectExporter.java:129) ~[classes/:?]
    at org.openbravo.service.external.integration.export.SynchronizableBusinessObjectExporter.exportToSynchronizableBusinessObject(SynchronizableBusinessObjectExporter.java:108) ~[classes/:?]
    at org.openbravo.service.external.integration.mapping.OneToManyEntityPropertyMapping.getTargetList(OneToManyEntityPropertyMapping.java:110) ~[classes/:?]
    at org.openbravo.service.external.integration.mapping.OneToManyEntityPropertyMapping.getMappingValueForExport(OneToManyEntityPropertyMapping.java:98) ~[classes/:?]
1.- Create a promotion in the back-end
2.- Add a configuration for the Incompatible Discounts tab (see attached image as an example)
3.- Using a REST client, create a request to get the previously created promotion. Example request for livebuilds:

https://livebuilds.openbravo.com/context/retail_modules_pgsql_pi/ws/org.openbravo.api.ExportService/Promotion/promotionId [^]

Just replace the base url and the promotionId by the created one

RESULT: The integration will fail
No tags attached.
Issue History
2024-10-14 18:01kchoperenaNew Issue
2024-10-14 18:01kchoperenaAssigned To => Retail
2024-10-14 18:01kchoperenaOBNetwork customer => OBPS
2024-10-14 18:01kchoperenaTriggers an Emergency Pack => No
2024-10-17 15:25guillermogilStatusnew => acknowledged
2024-10-23 09:12guillermogilAssigned ToRetail => guilleaer
2024-10-24 07:21Bimla_vmAssigned Toguilleaer => Bimla_vm
2024-10-24 07:22Bimla_vmStatusacknowledged => scheduled
2024-10-28 08:18hgbotMerge Request Status => open
2024-10-28 08:18hgbotNote Added: 0171002
2024-10-29 10:43hgbotMerge Request Statusopen => approved
2024-10-29 10:43hgbotNote Added: 0171094
2024-10-29 10:43hgbotResolutionopen => fixed
2024-10-29 10:43hgbotStatusscheduled => closed
2024-10-29 10:43hgbotNote Added: 0171095

Notes
(0171002)
hgbot   
2024-10-28 08:18   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.api/-/merge_requests/356 [^]
(0171094)
hgbot   
2024-10-29 10:43   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.api/-/merge_requests/356 [^]
(0171095)
hgbot   
2024-10-29 10:43   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.api [^]
Changeset: 254fb959ddc2bad2c3f302e6f824f044471d8fae
Author: Bimla Mayavan <b.mayavan@external.orisha.com>
Date: 29-10-2024 09:42:59
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.api/-/commit/254fb959ddc2bad2c3f302e6f824f044471d8fae [^]

Fixed ISSUE-56778: Modified incompatibleDiscount as non mandatory

---
M src-db/database/sourcedata/OBEI_PROP_MAP_INSTANCE.xml
---