specify / specify7

Specify 7
https://www.specifysoftware.org/products/specify-7/
GNU General Public License v2.0
60 stars 36 forks source link

One preparation can be added to a gift multiple times to exceed available prep count #4788

Open lexiclevenger opened 4 months ago

lexiclevenger commented 4 months ago

Describe the bug The same gift preparation can be added to a gift record more than once regardless of the available preparations if the record is not saved. If you save with more than one of the same preparation, you are given an error message. When trying to add more than the available number of preparations to a loan, you are told that there are no more preparations available.

To Reproduce Steps to reproduce the behavior:

  1. Go to Interactions
  2. Create Gift by choosing a record set or catalog numbers
  3. Add gift preparation and select the same preparation more times than the number of preparations available
  4. Fill in required fields and save
  5. See error message

Expected behavior Preparations should be marked as unavailable as seen in loans when trying to add more preparations than are available in gifts.

Screenshots If applicable, add screenshots to help explain your problem.

Behavior in Loan:

https://github.com/specify/specify7/assets/164079735/30b90e1c-b5eb-417d-8c49-60ee077c8db7

Behavior in Gift:

https://github.com/specify/specify7/assets/164079735/a14b3946-4dc3-440d-8b80-f59b0309cac6

Crash Report

Specify 7 Crash Report - 2024-04-12T20_50_00.994Z.txt

Please, also fill out the following information manually:

emenslin commented 1 month ago

Can recreate in edge (7.9.6)