Bug Tracker Incident #15645

 


Summary
Project
INCDT - xTuple ERP
Incident Category
Bugs
Incident Number
15645
Visibility
public


Product Version
3.8.0Alpha
Fixed In Version
3.8.0Beta


Summary
Foreign key error saving new employee


Description

Get the following db error saving a new employee record:

ERROR: duplicate key value violates unique constraint "emp_emp_number_key"
QPSQL: Unable to create query
INSERT INTO emp ( emp_code, emp_number, emp_active, emp_cntct_id, emp_warehous_id, emp_mgr_emp_id, emp_wage_type, emp_wage, emp_wage_curr_id, emp_wage_period, emp_dept_id, emp_shift_id, emp_notes, emp_image_id, emp_extrate, emp_extrate_period, emp_startdate, emp_name) VALUES ( 'TTOYS', '', TRUE, 1, NULL, NULL, 'H', 0, 1, 'H', NULL, NULL, '', NULL, 0, 'H', NULL, 'Tremendous Toys Incorporated') RETURNING emp_id;

Steps to reproduce:

Open TTOYS CRM account
Select Employee flag
Select Employee button
On Employee screen, select the SAVE button
See error


Details
Reporter
ptyler
CRM Account
xTuple
Status
Closed
Assigned
gmoskowitz


Priority
High
Severity
Minor
Updated
10-04-11 13:46
Resolution
Fixed



Comments

DateUsernameComment
09/28/11 06:10vinaysingu

Tested in xTuple version 3.8.0 Beta : Issue is fixed

09/12/11 15:02svn

Revision: 12425
http://postbooks.svn.sourceforge.net/postbooks/?rev=12425&view=rev
Author: gilmoskowitz
Date: 2011-09-12 19:02:41 +0000 (Mon, 12 Sep 2011)
Log Message:
-----------
bug #15645 - ensure the user enters an employee number on screen and give a nicer message if it's a duplicate

Modified Paths:
--------------
xtuple/trunk/common/errorReporter.cpp
xtuple/trunk/guiclient/employee.cpp

09/12/11 14:51gmoskowitz

A simpler reproduction:
System -> Employees -> List
click New
In the Employee window, enter a unique value in Employee but put a number that's already listed in the List Employees window in the Employee Number field.
click Save.

Note: this is a uniqueness constraint, not a foreign key constraint, that's being violated.

09/12/11 11:20ptyler

More information: I received this error because the employee record I was trying to save had a null value in the Employee Number field--and a previously created employee record also had a null value in the Employee Number field.

Suggestion: If foreign key errors can be shown as a result of this condition, then perhaps Employee Number should be a required field on the employee screen?

09/12/11 09:53ptyler

Get the following db error saving a new employee record:

ERROR: duplicate key value violates unique constraint "emp_emp_number_key"
QPSQL: Unable to create query
INSERT INTO emp ( emp_code, emp_number, emp_active, emp_cntct_id, emp_warehous_id, emp_mgr_emp_id, emp_wage_type, emp_wage, emp_wage_curr_id, emp_wage_period, emp_dept_id, emp_shift_id, emp_notes, emp_image_id, emp_extrate, emp_extrate_period, emp_startdate, emp_name) VALUES ( 'TTOYS', '', TRUE, 1, NULL, NULL, 'H', 0, 1, 'H', NULL, NULL, '', NULL, 0, 'H', NULL, 'Tremendous Toys Incorporated') RETURNING emp_id;

Steps to reproduce:

Open TTOYS CRM account
Select Employee flag
Select Employee button
On Employee screen, select the SAVE button
See error



Characteristics

CodeReview
Completed
Backport
No
Operating System
Windows XP
HaxTuple
No
Doc Flag
False
Copyright Assigned
Yes

Files

No Files

Related Documents

TypeNumberDescriptionRelationshipRemove
ProjectXTUPLEAPPSPorted From Mantisx


Subscribers

You do not have permission to view subscribers.


Incident History

DateUsernameFieldChange
10/04/11 13:46gmoskowitzDescription Updated: "Get the following db..." -> "Get the following db..."
09/12/11 09:53ptylerNewIncident Added
09/12/11 09:53ptylerFound In: -> 3.8.0Alpha
09/12/11 11:20ptylerSeveritySeverity Changed: Block -> Minor
09/12/11 14:51gmoskowitzStatusStatus Changed: New -> Assigned
09/12/11 14:51gmoskowitzAssignedAssigned to: "" -> "gmoskowitz"
09/12/11 15:08gmoskowitzCharacteristic CodeReview Added: "Needed"
09/12/11 15:08gmoskowitzStatusStatus Changed: Assigned -> Resolved
09/12/11 15:08gmoskowitzFixed In: -> 3.8.0
09/12/11 15:15gmoskowitzResolutionResolution Changed: -> Fixed
09/16/11 15:48reddogCharacteristic CodeReview Changed: "Needed" -> "Completed"
09/28/11 06:10vinaysinguDescription Updated: "Get the following db..." -> "Get the following db..."
09/28/11 06:10vinaysinguStatusStatus Changed: Resolved -> Closed
09/28/11 06:10vinaysinguCharacteristic Backport Added: "No"
09/28/11 06:10vinaysinguCharacteristic Operating System Added: "Windows XP"
09/28/11 06:10vinaysinguCharacteristic haxTuple Added: "No"
09/28/11 06:10vinaysinguCharacteristic Estimated Hours Added: ""
09/28/11 06:10vinaysinguCharacteristic Doc Flag Added: "False"
09/28/11 06:10vinaysinguCharacteristic Copyright Assigned Added: "Yes"
06/20/14 10:24bc_adminCharacteristic Points Deleted: ""