1.7 Alpha - New Supplier Account Type fails

If you try to create a Supplier Account Type with a name beginning with digits its fails - see below. However, if you create one called 'Test', you can then edit it and change its name to '30 Day Supplier'.

Further testing indicates its not 'starts with digits' that is the problem - I was able to make a '31 Day Supplier' and a '60 Day Supplier', but then I deleted the '30 Day Supplier' that I made by changing the name from 'Test', and when I tried to make a new '30 Day Supplier' it still fails as per below.

I made the CSH page back on 23May (see http://www.openvpms.org/documentation/csh/1.7/admin/lookup/supplierAccou...) and that has the '30 Day Supplier' as the example so maybe something went wrong then and left some remanent in the database.

The full error log is attached [though you can duplicate the problem any time in the demo system - just try to create '30 Day Supplier'].

Regards, Tim G

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: 1.7 Alpha - New Supplier Account Type fails

The relevant part of the error message is:

<type>org.springframework.dao.DataIntegrityViolationException</type>
<message>could not insert: [org.openvpms.component.business.dao.hibernate.im.lookup.LookupDOImpl]; SQL [insert into lookups (version, linkId, active, arch_short_name, arch_version, code, name, description, default_lookup) values (?, ?, ?, ?, ?, ?, ?, ?, ?)]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not insert: [org.openvpms.component.business.dao.hibernate.im.lookup.LookupDOImpl]</message>
<stackTrace>

Basically there is already a Supplier Account Type lookup in the database with the code 30_DAY_SUPPLIER, but it is inactive. See https://openvpms.atlassian.net/browse/OVPMS-1075

-Tim A

Re: 1.7 Alpha - New Supplier Account Type fails

Tim A - sorry I should have thought of turning on the Include Deactivated.  Playing with the system, I cannot duplicate the problem - I always get a nice error message.

However, I did uncover a non-obvious behaviour as follows:

  1. create a lookup, say 'test'
  2. create another, say 'test xxx' 
  3. edit the second to change its name to 'test'

You now have two lookups both named 'test'.  If you now try to create another named 'test xxx' you will get an error saying that the code 'TEST_XXX' already exists.

I understand why this is happening (because the name change did not change the code, and the code is not displayed so it's not obvious what is happening).

Perhaps we should display the lookup code.

[In an earlier life, I had a program that had in its help text, a section entitled 'Come here when all else fails' and in there I put all the gotcha's - like the one above. Maybe I should add a similar section to the CSH pages.]

Regards, Tim G

Syndicate content