Openbravo Issue Tracking System - Retail Modules
View Issue Details
0052562Retail ModulesRetail APIpublic2023-05-25 09:462023-07-14 11:45
ngarcia 
ranjith_qualiantech_com 
urgentmajoralways
closedfixed 
5
 
 
No
0052562: Business Partner update through JSON Based Import Process EDL process fails if the bp has two contacts with same name
Business Partner update through JSON Based Import Process EDL process fails if the bp has two contacts with same name

It finishes with:

Error while importing an item: query did not return a unique result: 2

The property that identifies uniquely a contact is the first name:

select m.mapped_entity, m.mapping_entity, i.mapping_name
from OBEI_entity_mapping m, OBEI_Prop_Map_Instance i
where m.OBEI_entity_mapping_id = i.OBEI_entity_mapping_id
and m.mapping_entity = 'ADUser'
and i.identifies_univocally = 'Y';
mapped_entity | mapping_entity | mapping_name
---------------+----------------+--------------
ContactInfo | ADUser | firstName
User | ADUser | username
(2 rows)
Add two contacts with the same first name to a business partner

Try to import it through JSON Based Import Process EDL Process and check the EDL Request finishes with the following error:

Error while importing an item: query did not return a unique result: 2

The log shows:

Caused by: org.hibernate.NonUniqueResultException: query did not return a unique result: 2
    at org.hibernate.query.internal.AbstractProducedQuery.uniqueElement(AbstractProducedQuery.java:1684) ~[hibernate-core-5.6.0.Final.jar:5.6.0.Final]
    at org.hibernate.query.internal.AbstractProducedQuery.uniqueResult(AbstractProducedQuery.java:1659) ~[hibernate-core-5.6.0.Final.jar:5.6.0.Final]
    at org.openbravo.dal.service.OBQuery.uniqueResult(OBQuery.java:100) ~[classes/:?]
    at org.openbravo.service.external.integration.importer.DalSynchronizableBusinessObjectImporter.getBobFromUniqueProperties(DalSynchronizableBusinessObjectImporter.java:192)
...
No tags attached.
related to defect 0052748 closed ranjith_qualiantech_com Currently it is not possible to uniquely identify a contact of a business partner 
Issue History
2023-05-25 09:46ngarciaNew Issue
2023-05-25 09:46ngarciaAssigned To => Triage Platform Conn
2023-05-25 13:22marvintmAssigned ToTriage Platform Conn => Retail
2023-05-25 13:23marvintmProjectModules => Retail Modules
2023-05-25 13:23marvintmTriggers an Emergency Pack => No
2023-05-25 13:23marvintmCategoryExternal Data Integration => Retail API
2023-05-29 11:09ranjith_qualiantech_comAssigned ToRetail => ranjith_qualiantech_com
2023-05-29 15:49ranjith_qualiantech_comStatusnew => scheduled
2023-05-30 05:03hgbotNote Added: 0150449
2023-06-07 10:56hgbotResolutionopen => fixed
2023-06-07 10:56hgbotStatusscheduled => closed
2023-06-07 10:56hgbotNote Added: 0150853
2023-06-07 10:56hgbotNote Added: 0150854
2023-06-15 09:46ngarciaRelationship addedrelated to 0052748
2023-07-14 11:39ngarciaRelationship addedrelated to 0052969
2023-07-14 11:45ngarciaRelationship deletedrelated to 0052969

Notes
(0150449)
hgbot   
2023-05-30 05:03   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.api/-/merge_requests/150 [^]
(0150853)
hgbot   
2023-06-07 10:56   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.api [^]
Changeset: fdf68d43cb42319acffe29a737f34ed095375c1b
Author: Ranjith S R <ranjith@qualiantech.com>
Date: 06-06-2023 11:47:54
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.api/-/commit/fdf68d43cb42319acffe29a737f34ed095375c1b [^]

Fixed ISSUE-52562: Added LastName as unique identifier in ContactInfo
* When importing BusinessPartner, First Name and Last Name should be set
  as unique identifier in ContactInfo

---
M src-db/database/sourcedata/OBEI_PROP_MAP_INSTANCE.xml
---
(0150854)
hgbot   
2023-06-07 10:56   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.api/-/merge_requests/150 [^]