Openbravo Issue Tracking System - Retail Modules
View Issue Details
0038108Retail ModulesWeb POSpublic2018-03-13 10:282018-03-19 09:48
maite 
ranjith_qualiantech_com 
urgentmajoralways
closedfixed 
5
 
RR18Q2 
marvintm
No
0038108: Business Partner stuck in Errors While Importing due to "violates unique constraint "ad_user_un_username"" error
When several business partners with same name are created, the 4 first digits of uuid are concatenated to the value field in order to try to synchronize it. But this 4 first digits could not be unique so error is raised

org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "ad_user_un_username"
  Detail: Key (username)=(test_9B28) already exists.
1. From the POS terminal, run "New customer" process. Set name= test and any address
2. Repeat step 1
3. Repeat step 1
3. Access backoffice and realize that Business Partner records with value "test", "test_9535" and "test_4EDE" and User records with same usernames have been created

In case uuid generated starts with the same 4 digits you will obtain the error and Business Partner will be stuck in Errors While Importing window
No tags attached.
Issue History
2018-03-13 10:28maiteNew Issue
2018-03-13 10:28maiteAssigned To => Retail
2018-03-13 10:28maiteResolution time => 1491170400
2018-03-13 10:28maiteTriggers an Emergency Pack => No
2018-03-13 10:28maiteIssue Monitored: networkb
2018-03-13 12:55ranjith_qualiantech_comAssigned ToRetail => ranjith_qualiantech_com
2018-03-13 12:55ranjith_qualiantech_comStatusnew => scheduled
2018-03-13 13:05marvintmResolution time1491170400 => 1522706400
2018-03-14 09:48hgbotCheckin
2018-03-14 09:48hgbotNote Added: 0103233
2018-03-14 09:48hgbotStatusscheduled => resolved
2018-03-14 09:48hgbotResolutionopen => fixed
2018-03-14 09:48hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/1dd5a639244ae28edf77e6baf196137e2f3cdc21 [^]
2018-03-19 09:48marvintmReview Assigned To => marvintm
2018-03-19 09:48marvintmStatusresolved => closed
2018-03-19 09:48marvintmFixed in Version => RR18Q2

Notes
(0103233)
hgbot   
2018-03-14 09:48   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 1dd5a639244ae28edf77e6baf196137e2f3cdc21
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Wed Mar 14 14:18:10 2018 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/1dd5a639244ae28edf77e6baf196137e2f3cdc21 [^]

Fixed issue 38108 : Unique search key should be generated while adding new customers

* If Customer Search key already exists, new search key should be generated by appending 4 digit random number
* Same applies for User username

---
M src/org/openbravo/retail/posterminal/CustomerLoader.java
---