Openbravo Issue Tracking System - Retail Modules
View Issue Details
0052748Retail ModulesRetail APIpublic2023-06-15 09:462023-06-26 07:03
ngarcia 
ranjith_qualiantech_com 
urgentmajoralways
closedfixed 
5
 
 
No
0052748: Currently it is not possible to uniquely identify a contact of a business partner
Currently, it is not possible to uniquely identify a contact of a business partner

The contacts of a business partner are created without username, so it is not possible to uniquely identify them
Add two contacts with the same first and last 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)
...
Issue changed from Design Defect to Defect as we need to fix the fact that "Last Name" "Name" can not be used to uniquely identify Contacts.

The proposal is by now, use the property "Phone" as the parameter to identify a contact uniquely.
No tags attached.
related to defect 0052562 closed ranjith_qualiantech_com Business Partner update through JSON Based Import Process EDL process fails if the bp has two contacts with same name 
Issue History
2023-06-15 09:46ngarciaNew Issue
2023-06-15 09:46ngarciaAssigned To => Triage Platform Conn
2023-06-15 09:46ngarciaTriggers an Emergency Pack => No
2023-06-15 09:46ngarciaRelationship addedrelated to 0052562
2023-06-16 15:14psanjuanAssigned ToTriage Platform Conn => psanjuan
2023-06-16 15:14psanjuanProposed Solution updated
2023-06-19 12:01psanjuanAssigned Topsanjuan => Retail
2023-06-19 12:01psanjuanTypedesign defect => defect
2023-06-19 12:01psanjuanProposed Solution updated
2023-06-19 12:34ranjith_qualiantech_comAssigned ToRetail => ranjith_qualiantech_com
2023-06-19 14:57ranjith_qualiantech_comStatusnew => scheduled
2023-06-22 06:29hgbotNote Added: 0151467
2023-06-26 07:03hgbotResolutionopen => fixed
2023-06-26 07:03hgbotStatusscheduled => closed
2023-06-26 07:03hgbotNote Added: 0151613
2023-06-26 07:03hgbotNote Added: 0151614

Notes
(0151467)
hgbot   
2023-06-22 06:29   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.api/-/merge_requests/159 [^]
(0151613)
hgbot   
2023-06-26 07:03   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.api [^]
Changeset: 87c7b023567f2886cd709a4844623151a554e139
Author: Ranjith S R <ranjith@qualiantech.com>
Date: 23-06-2023 13:31:44
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.api/-/commit/87c7b023567f2886cd709a4844623151a554e139 [^]

Fixed ISSUE-52748: Phone should be unique identifier of ContactInfo
* Phone property should be not null and unique identifier
  when importing BusinessPartner/ContactInfo

---
M examples/Openbravo API.postman_collection.json
M src-db/database/sourcedata/OBEI_PROP_MAP_INSTANCE.xml
---
(0151614)
hgbot   
2023-06-26 07:03   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.api/-/merge_requests/159 [^]