Skip to content

Don't allow deletion of items that are part of a request #4728

@cielf

Description

@cielf

Summary

If you delete an item, any requests using that item are unviewable So you shouldn't be able to delete an item if there are any requests.

Why?

Hygiene. This is unlikely to happen in the wild.

Details

Recreation

Sign in as org_admin1,
Click on Partner Agencies, then All Partners in the left hand menu
Click on Pawnee Parent Service.
Click Edit Partner Information
Set Group to None
Update Partner
Click on Inventory, then Items& Inventory in the left hand menu.
Click on New Item
Fill in some info, make sure Item is Visible to Partners? is checked
Save
Logout
Sign in as verified@example.com
Create a request that includes that item
Save and confirm
Login as org_Admin1@example.com
click on requests -- you will see that request
Click on Inventory | Items & Inventory
click on "Delete" beside the item that you added
Confirm
Click on Requests -- it was still showing the request for me, but that might be caching?
Click on View -- Get a "Still haven't found what you're looking for"

What should happen

  • Don't allow deletion of items that are part of a request
  • there should be no delete button on the item. There should, however, be a deactivate button.

Criteria for completion

  • behaviour as described above
  • tests to support the behaviour

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions