Can't use a Storage Location more than once via the Object Use History bundle

Description

It is not possible to associate a storage location with an object more than once, via the Object Use History bundle.

As I understand it, the Object Use History records the history of an object's locations (i.e. storage locations, loans, etc). However it only actually seems to reflect the current state, and does not really keep a history.


STEPS TO REPRODUCE

0. Add the Object Use History bundle to a relevant screen and configure it correctly, so that it shows at least storage locations, and possibly other relationships (loans, etc).

1. Navigate to (or create) an object that uses the relevant editor UI, and navigate to the screen containing the Object Use History bundle.

2. Click "Update location" and select location X (any location will do). Save the record. The history stream will now contain location X.

3. Click "Update location" a second time and select location Y (i.e. any location other than X). Save the record. The history stream will now contain locations X and Y. This is correct.

4. Click "Update location" a third time and select location X again (i.e. the same as at step 2). Save the record.

EXPECTED: The history stream shows location X, followed by Y, followed by X again.

ACTUAL: The history stream shows location X, followed by Y, but does not record the new instance of X.

CAUSE: The object is already (still) associated with location X, and we can't have two relationships between the same two records.

So let's try something different...


Follow steps 1-3 the same as above, then between steps 3 and 4, remove the relationship to location X (probably using the standard relationship bundle). Then proceed with step 4.

EXPECTED: The history stream shows location X, followed by Y, followed by X again.

ACTUAL: The history stream shows location Y, followed by location X, but the original instance of location X is now gone.

CAUSE: We've removed the original relationship to location X, which also appears to have removed it from the history.


P.S. There is a pull request on github which makes the Update Location autocomplete and quick add form work correctly. This needs to be merged before the above can be reproduced.

Environment

None

Activity

Show:
Ben New
June 26, 2014, 4:19 AM

First line of second process is meant to say "Follow steps 0-3" instead of "Follow steps 1-3".

User known
June 27, 2014, 11:37 PM

The first issue – can't add the same location twice to the history – is fixed in GitHub develop.

User known
June 27, 2014, 11:40 PM

The second issue is a consequence of how storage location history is maintained. The history is stored in a series of date constrained object-location relationships. The object use and current object location bundles mediate access to these relationships and prevent them from being removed. The ca_storage_locations bundle does not mediate; users have access to the "raw" relationships and can delete them if desired. In general you should not include the ca_storage_locations bundle in your UI if you're using the object use history and current location bundles.

Ben New
July 3, 2014, 4:00 AM

Excellent thanks Seth, it does indeed fix the problem. I think we only needed one of the two so that's all good

Also yes it makes sense to only have one or the other – i.e. ca_storage_locations bundle or ca_object_use_history bundle – but not both.

Assignee

User known

Reporter

Ben New

Components

Affects versions

Priority

Major