Bug Tracker Incident #9302

 


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


Product Version
3.3.0Beta3
Fixed In Version
4.0.0Beta3


Summary
Omnibus: Disallow records with duplicate or blank human readable key values


Description

Disallow records with duplicate or blank human readable key values. Let's roll this into a single effort to stem the tidal wave of reports on this subject for every manifestation. We've had similar issues, such as problems with displays that require us to scour the app.

Any examples found should be added to the additional information section of this issue.


Details
Reporter
srikanth
CRM Account
xTincident Default Account
Status
Closed
Assigned
gmoskowitz


Priority
High
Severity
Minor
Updated
11-08-12 01:32
Resolution
Fixed



Comments

DateUsernameComment
11/08/12 01:32shyamsunder

Tested in xtuple version 4.0.0 Beta3: Closing the issue based on the latest comment

11/07/12 10:12jrogelstad

Empty address are allowed - The address is not a key. There is an address number (not shown on the GUI) that is the key.
User is allowed to duplicate Opportunity records - How? It has an non-editable number key.
User is allowed to enter duplicate contacts to the contact list in CRM - Again, how? Contact also has non-editable number. Names have to be able to be duplicated.
It is possible to create a blank credit memo - I observe that both Sales credit memo and Misc. CM require a number.
User is allowed to save empty EDI profile - This is not core. Create a separate issue.
User is allowed to save duplicate Commission schedules - This is not core. Create a separate issue.
User is allowed to save duplicate Commission schedule assignments - This is not core. Create a separate issue.
Empty comments can be saved for lot/serial controlled item - Not relevant. Comments are not a key.
Empty comments can be saved for CRM contact,account - Note relevant. Comments are not a key.

Please re-test.

11/07/12 08:33shyamsunder

Tested in xTuple version 4.0.0 Beta3: Observed that issue still reproducible in following scenarios.

Empty address are allowed
User is allowed to duplicate Opportunity records
User is allowed to enter duplicate contacts to the contact list in CRM
It is possible to create a blank credit memo
User is allowed to save empty EDI profile
User is allowed to save duplicate Commission schedules
User is allowed to save duplicate Commission schedule assignments
Empty comments can be saved for lot/serial controlled item
Empty comments can be saved for CRM contact,account

09/11/12 15:20svn

Revision: 14004
http://postbooks.svn.sourceforge.net/postbooks/?rev=14004&view=rev
Author: gilmoskowitz
Date: 2012-08-28 12:50:45 +0000 (Tue, 28 Aug 2012)
Log Message:
-----------
issue #9302 and issue #8330 - support for better messages for certain constraint violations

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

09/11/12 15:05svn

Revision: 14000
http://postbooks.svn.sourceforge.net/postbooks/?rev=14000&view=rev
Author: gilmoskowitz
Date: 2012-08-27 18:39:24 +0000 (Mon, 27 Aug 2012)
Log Message:
-----------
issue #9302 - missed taxreg previously in xtupleserver

Modified Paths:
--------------
xtupleserver/trunk/updatescripts/from_400beta2/uniqueCodes.sql

09/11/12 14:49svn

Revision: 13999
http://postbooks.svn.sourceforge.net/postbooks/?rev=13999&view=rev
Author: gilmoskowitz
Date: 2012-08-27 15:56:29 +0000 (Mon, 27 Aug 2012)
Log Message:
-----------
issue #9302 - standard edition client side.
dealt with problems saving intermediate new transfer orders, where there was
confusion over which t/o was meant when the user typed the # of an existing t/o.
also updated error handling (issue #8330), fixed uninitialized variable problems,
and removed unused class members.

Modified Paths:
--------------
xtuple/trunk/guiclient/transferOrder.cpp
xtuple/trunk/guiclient/transferOrder.h

09/11/12 14:43svn

Revision: 13999
http://postbooks.svn.sourceforge.net/postbooks/?rev=13999&view=rev
Author: gilmoskowitz
Date: 2012-08-27 15:56:29 +0000 (Mon, 27 Aug 2012)
Log Message:
-----------
issue #9302 - standard edition client side.
dealt with problems saving intermediate new transfer orders, where there was
confusion over which t/o was meant when the user typed the # of an existing t/o.
also updated error handling (issue #8330), fixed uninitialized variable problems,
and removed unused class members.

Modified Paths:
--------------
xtuple/trunk/guiclient/transferOrder.cpp
xtuple/trunk/guiclient/transferOrder.h

09/11/12 14:26svn

Revision: 13999
http://postbooks.svn.sourceforge.net/postbooks/?rev=13999&view=rev
Author: gilmoskowitz
Date: 2012-08-27 15:56:29 +0000 (Mon, 27 Aug 2012)
Log Message:
-----------
issue #9302 - standard edition client side.
dealt with problems saving intermediate new transfer orders, where there was
confusion over which t/o was meant when the user typed the # of an existing t/o.
also updated error handling (issue #8330), fixed uninitialized variable problems,
and removed unused class members.

Modified Paths:
--------------
xtuple/trunk/guiclient/transferOrder.cpp
xtuple/trunk/guiclient/transferOrder.h

09/11/12 14:26svn

Revision: 13999
http://postbooks.svn.sourceforge.net/postbooks/?rev=13999&view=rev
Author: gilmoskowitz
Date: 2012-08-27 15:56:29 +0000 (Mon, 27 Aug 2012)
Log Message:
-----------
issue #9302 - standard edition client side.
dealt with problems saving intermediate new transfer orders, where there was
confusion over which t/o was meant when the user typed the # of an existing t/o.
also updated error handling (issue #8330), fixed uninitialized variable problems,
and removed unused class members.

Modified Paths:
--------------
xtuple/trunk/guiclient/transferOrder.cpp
xtuple/trunk/guiclient/transferOrder.h

09/11/12 14:16svn

Revision: 13999
http://postbooks.svn.sourceforge.net/postbooks/?rev=13999&view=rev
Author: gilmoskowitz
Date: 2012-08-27 15:56:29 +0000 (Mon, 27 Aug 2012)
Log Message:
-----------
issue #9302 - standard edition client side.
dealt with problems saving intermediate new transfer orders, where there was
confusion over which t/o was meant when the user typed the # of an existing t/o.
also updated error handling (issue #8330), fixed uninitialized variable problems,
and removed unused class members.

Modified Paths:
--------------
xtuple/trunk/guiclient/transferOrder.cpp
xtuple/trunk/guiclient/transferOrder.h

09/11/12 14:16svn

Revision: 13999
http://postbooks.svn.sourceforge.net/postbooks/?rev=13999&view=rev
Author: gilmoskowitz
Date: 2012-08-27 15:56:29 +0000 (Mon, 27 Aug 2012)
Log Message:
-----------
issue #9302 - standard edition client side.
dealt with problems saving intermediate new transfer orders, where there was
confusion over which t/o was meant when the user typed the # of an existing t/o.
also updated error handling (issue #8330), fixed uninitialized variable problems,
and removed unused class members.

Modified Paths:
--------------
xtuple/trunk/guiclient/transferOrder.cpp
xtuple/trunk/guiclient/transferOrder.h

08/31/12 17:22gmoskowitz

response to code review comments: First off, thanks for slogging through all of that.

> rev 13992 in uniqueCodes.sql, line ALTER TABLE "char" changed to ALTER TABLE char?<--same thing in fixNonUniqueCodes.sql

CHAR is a keyword in SQL and so has to be quoted when we refer to the table with that name. "char" was a poor choice for a table name but it's too late to change that(?).

> Precheck file needs some sort of extension, .sql?

Nope - the Precheck file is there as a reminder to the person who builds the upgrade package to include those statements in the package.xml file, with appropriate messages to give the user guidance on how to fix the problem before the upgrade can be completed. This file is not intended to be run directly as part of the upgrade.

> rev 13993 printQuote.cpp
> " OR (quhead_id IN (-1"
> " <? foreach('docidlist') ?>,<? value('docidlist') ?><? endforeach ?>))" metasql tags in cpp?

This particular change was backed out in rev 13994. Even so, this is legal MetaSQL syntax and the query string defined in the .cpp file is passed to the MetaSQL parser before it's executed.

> rev 13999 transferOrder.cpp couple references to ;//nothing to do, remove the queries?

We can't remove the queries because they do actual work (addToPackingListBatch and releaseToNumber). There used to be error-handling code in the blocks after QSqlQuery::first() but that's no longer necessary. The empty statements are there as place-holders until we decide how to deal with them as part of fixing 8330 and the comments are there to ensure maintainers notice them.

> rev 8795 Precheck file needs an extension, .sql?

see above

> $$ LANGUAGE PLPGSQL; possibly needs to be single quoted in file fixNonUniqueCodes.sql

Turns out that isn't necessary. From http://www.postgresql.org/docs/8.4/interactive/sql-createfunction.html :
langname
The name of the language that the function is implemented in. Can be SQL, C, internal, or the name of a user-defined procedural language. For backward compatibility, the name can be enclosed by single quotes.

08/31/12 15:54gpazo

Code Review:

rev 13992 in uniqueCodes.sql, line ALTER TABLE "char" changed to ALTER TABLE char?<--same thing in fixNonUniqueCodes.sql
Precheck file needs some sort of extension, .sql?

rev 13993 printQuote.cpp
" OR (quhead_id IN (-1"
" <? foreach('docidlist') ?>,<? value('docidlist') ?><? endforeach ?>))" metasql tags in cpp?

rev 13999 transferOrder.cpp couple references to ;//nothing to do, remove the queries?

rev 8795 Precheck file needs an extension, .sql?
$$ LANGUAGE PLPGSQL; possibly needs to be single quoted in file fixNonUniqueCodes.sql

08/27/12 16:08gmoskowitz

Commits not automatically added as comments on this issue:
xtuple rev 13999 - std edition client side
xtupleserver rev 14000 - taxreg
standardserver rev 8795
xtbatch rev 8796
xtcommission rev 8798
xtmfg rev 8799

Most of the changes for this issue prevent database inserts and updates that would create NULL, empty, or duplicate numbers/codes/names/etc. These were usually prevented by desktop client or script code but could still be created with data import via CSV or XML or SQL or other clients.

These changes do not address the complaint about empty comments. Internal discussion revealed that there are use cases for these. These changes also do not address potential concerns about numbers/codes/names/etc. consisting entirely of whitespace characters.

08/21/12 14:20svn

Revision: 13994
http://postbooks.svn.sourceforge.net/postbooks/?rev=13994&view=rev
Author: gilmoskowitz
Date: 2012-08-21 18:20:44 +0000 (Tue, 21 Aug 2012)
Log Message:
-----------
bug #9302 and issue #8330 - backing out accidental commits that are part of a different bug fix

Modified Paths:
--------------
xtuple/trunk/guiclient/printQuote.cpp
xtuple/trunk/guiclient/printSinglecopyDocument.cpp
xtuple/trunk/guiclient/quotes.cpp

08/21/12 14:17svn

Revision: 13993
http://postbooks.svn.sourceforge.net/postbooks/?rev=13993&view=rev
Author: gilmoskowitz
Date: 2012-08-21 18:17:08 +0000 (Tue, 21 Aug 2012)
Log Message:
-----------
bug #9302 - postbooks client side (more useful after issue #8330 gets addressed)

Modified Paths:
--------------
xtuple/trunk/common/errorReporter.cpp
xtuple/trunk/guiclient/printQuote.cpp
xtuple/trunk/guiclient/printSinglecopyDocument.cpp
xtuple/trunk/guiclient/quotes.cpp

08/21/12 13:42svn

Revision: 13992
http://postbooks.svn.sourceforge.net/postbooks/?rev=13992&view=rev
Author: gilmoskowitz
Date: 2012-08-21 17:42:33 +0000 (Tue, 21 Aug 2012)
Log Message:
-----------
bug #9302 - postbooks server side

Added Paths:
-----------
xtupleserver/trunk/updatescripts/from_400beta2/Precheck
xtupleserver/trunk/updatescripts/from_400beta2/fixNonUniqueCodes.sql
xtupleserver/trunk/updatescripts/from_400beta2/uniqueCodes.sql

07/05/12 13:38svn

Revision: 13800
http://postbooks.svn.sourceforge.net/postbooks/?rev=13800&view=rev
Author: sunsetsolutions
Date: 2012-07-05 17:38:42 +0000 (Thu, 05 Jul 2012)
Log Message:
-----------
Issue #9302:avoid duplicate records

Modified Paths:
--------------
xtuple/trunk/guiclient/checkFormat.cpp
xtuple/trunk/guiclient/classCode.cpp
xtuple/trunk/guiclient/externalShipping.cpp
xtuple/trunk/guiclient/form.cpp
xtuple/trunk/guiclient/group.cpp
xtuple/trunk/guiclient/itemAlias.cpp

04/05/12 04:54vinaysingu

User is allowed to save duplicate Sales Rep Groups
User is allowed to save duplicate Commission schedules
User is allowed to save duplicate Commission schedule assignments

01/11/12 08:38gmoskowitz

Quotes can be created with blank quote numbers (16747 reported in 3.8.0RC2)

03/23/11 01:46vinaysingu

Duplicate Tax Registrations with exactly same details can be created

03/04/11 08:25mfgadmin

Additional Info:

Here are some examples found:

It is possible to duplicate class codes
Duplication of Standard Operation # is allowed
Duplicate Unit of Measure causes error
Empty aliases in item allowed
Empty Address allowed
Duplicate maintain groups causes error
It is possible to duplicate forms (System - M.I - forms)
It is possible to duplicate Check formats (Accounting - M.I - Check formats)
User is allowed to save an empty External shipping record
User is allowed to duplicate Opportunity records
User is allowed to enter duplicate contacts to the contact list in CRM
Duplication of work centers is allowed
Empty comments can be saved for lot/serial controlled item
It is possible to create a blank credit memo
User is allowed to save empty EDI profile
User is allowed to duplicate production plan item
Empty comments can be saved for CRM contact,account

03/04/11 08:25mfgadmin

Disallow records with duplicate or blank human readable key values. Let's roll this into a single effort to stem the tidal wave of reports on this subject for every manifestation. We've had similar issues, such as problems with displays that require us to scour the app.

Any examples found should be added to the additional information section of this issue.



Characteristics

Backport
No
CodeReview
Completed
Operating System
 
Doc Flag
False
Regression
No
BugHunt2012
yes
Copyright Assigned
Yes
HaxTuple
No
Points
None

Files

No Files

Related Documents

TypeNumberDescriptionRelationshipRemove
ProjectXTUPLEAPPSPorted From Mantisx


Subscribers

You do not have permission to view subscribers.


Incident History

DateUsernameFieldChange
12/16/10 09:14acdrupalNewIncident Added
12/14/11 07:53gmoskowitzDescription Updated: "Disallow records wit..." -> "Disallow records wit..."
12/14/11 07:53gmoskowitzPriorityPriority Changed: Normal -> High
12/14/11 08:03gmoskowitzFound In: -> 3.3.0Beta3
08/13/12 14:39gmoskowitzStatusStatus Changed: Confirmed -> Assigned
08/13/12 14:39gmoskowitzAssignedAssigned to: "" -> "gmoskowitz"
08/27/12 16:08gmoskowitzCharacteristic CodeReview Added: "Needed"
08/27/12 16:08gmoskowitzStatusStatus Changed: Assigned -> Resolved
08/27/12 16:08gmoskowitzResolutionResolution Changed: Open -> Fixed
08/27/12 16:08gmoskowitzFixed In: -> 4.0.0
08/27/12 16:09gmoskowitzCharacteristic BugHunt2012 Added: "yes"
08/31/12 13:25gmoskowitzCharacteristic CodeReview Changed: "Needed" -> "In Progress"
08/31/12 17:22gmoskowitzCharacteristic CodeReview Changed: "In Progress" -> "Completed"
11/07/12 08:33shyamsunderDescription Updated: "Disallow records wit..." -> "Disallow records wit..."
11/07/12 08:33shyamsunderStatusStatus Changed: Resolved -> Assigned
11/07/12 08:33shyamsunderCharacteristic Regression Added: "No"
11/07/12 10:12jrogelstadCharacteristic CodeReview Changed: "Completed" -> "Needed"
11/07/12 10:12jrogelstadStatusStatus Changed: Assigned -> Resolved
11/07/12 10:12jrogelstadCharacteristic CodeReview Changed: "Needed" -> "Completed"
11/08/12 01:32shyamsunderStatusStatus Changed: Resolved -> Closed