Openbravo Issue Tracking System - Retail Modules
View Issue Details
0057340Retail ModulesRetail APIpublic2024-11-05 11:552024-12-02 13:31
hbrasme 
jgalarza 
normalmajoralways
closedfixed 
5
 
RR24Q4 
No
0057340: API Product - Error when updating a related product
Following the implementation of contributions, management is carried out through the related product and the multiplier field.

However, this field must be able to be updated when the contribution is revised


Currently when I want to update a multiplier I get the error message below:

ERROR: duplicate key value violates unique constraint "m_product_service_prod"
Detail: Key (m_product_id, m_related_product_id)=(358807CC49444D5DB82C0FD66AE7F678, 7A763395EA494A13B0D5FF4D920B48DF) already exists
Create a related product to a contribution like that :

[
   {
      "client":"TERRENA",
      "organization":"*",
      "searchKey":"Contribution RPD",
      "relatedProducts":[{
         "product":"1200900",
         "multiplicator":1.14,
         "active":true
         }
      ]
   }
   
]


Try to change the multiplicator field (Put 1.25 instead of 1.14) :

[
   {
      "client":"TERRENA",
      "organization":"*",
      "searchKey":"Contribution RPD",
      "relatedProducts":[{
         "product":"1200900",
         "multiplicator":1.25,
         "active":true
         }
      ]
   }
   
]
It would be necessary to be able to update the related products if they already exist.
No tags attached.
blocks defect 0056980 closed jgalarza API Product - Error when updating a related product 
Issue History
2024-12-02 10:39jgalarzaTypedefect => backport
2024-12-02 10:39jgalarzaTarget Version => RR24Q4
2024-12-02 12:37hgbotNote Added: 0172879
2024-12-02 13:07hgbotNote Added: 0172882
2024-12-02 13:16hgbotNote Added: 0172883
2024-12-02 13:31hgbotResolutionopen => fixed
2024-12-02 13:31hgbotStatusscheduled => closed
2024-12-02 13:31hgbotNote Added: 0172892
2024-12-02 13:31hgbotNote Added: 0172893

Notes
(0172879)
hgbot   
2024-12-02 12:37   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.api/-/merge_requests/399 [^]
(0172882)
hgbot   
2024-12-02 13:07   
Merge request closed: https://gitlab.com/openbravo/product/pmods/org.openbravo.api/-/merge_requests/399 [^]
(0172883)
hgbot   
2024-12-02 13:16   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.api/-/merge_requests/400 [^]
(0172892)
hgbot   
2024-12-02 13:31   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.api [^]
Changeset: 7e10343dd6bf4e975c749eb733f903e81cdd4708
Author: j.galarz <j.galarza@orisha.com>
Date: 02-12-2024 12:37:30
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.api/-/commit/7e10343dd6bf4e975c749eb733f903e81cdd4708 [^]

Fixes ISSUE-57340: API Product - Error when updating a related product

---
M src-db/database/sourcedata/OBEI_PROP_MAP_INSTANCE.xml
M src/org/openbravo/api/mappings/product/ImportProductJavaPropertyMappingHandler.java
---
(0172893)
hgbot   
2024-12-02 13:31   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.api/-/merge_requests/400 [^]