specify / specify7

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

`IsResolved` is not set to false despite associated Loan Return Preparations being deleted or unresolved #4883

Open bronwyncombs opened 6 months ago

bronwyncombs commented 6 months ago

Describe the bug A clear and concise description of what the bug is.

You can return a loan two ways

  1. Loan return preparation form, per preparation
  2. Return Loan button to manage returns for all preps on the loan

When using loan return prep form, save is not enabled once created or deleted in production, but this is fixed on edge.

However, there is still an issue with the "Is Resolved" checkbox being unaffected by manual LRP creations.

Also, the loan is returned via "return loan" and then the LRP is deleted, the checkbox stays selected even though the preparation is no longer resolved.

From Corinna @ CSIRO:

When a loan preparation is resolved manually via its Loan Return Preparation, the Is Resolved box does not get ticked. When using the Return Loan function this works as expected. This is also the case when you un-resolve a preparation, i.e., on removing a previously resolved preparation where the box is ticked (i.e., completed via the Return Loan function), the tick stays even though the preparation is not resolved any longer.  

Screenshot 2024-05-03 at 11 40 41 AM

I also found that on demofish instance (7.9.3.1), the checkbox was not affected with either return method.

https://github.com/specify/specify7/assets/135047322/dbe43557-2de6-4203-bc10-3660be9cb90e

On edge, the save enabling issue is fixed but the behavior still matches their report

https://github.com/specify/specify7/assets/135047322/3721d52e-b5a9-4c5d-bbf1-1bd7b1bacade

Reported By CSIRO

emenslin commented 4 months ago

Can recreate in edge (7.9.6)

bronwyncombs commented 3 months ago

In addition to the checkbox reported in the initial issue, deleting a loan return prep is logistically ineffective for two more reasons:

  1. virtual count fields (resolved preps and resolved items) aren't reduced, and the inversely corresponding fields (unresolved preps and unresolved items) values aren't increased
  2. loan record will still appear as resolved in 'See Loans' dialog on preparation forms
grantfitzsimmons commented 3 months ago

IsResolved is not a virtual field, it is a database field that should be checked/unchecked via business rules.