-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Exchange Out, Disposal, Gift, and Deaccession Virtual Calculated Fields #4824
Conversation
I found the file https://github.com/specify/specify7/blob/production/specifyweb/specify/calculated_fields.py where many of the already implemented virtual calculated fields are coded. I think it will be good to extend this file, instead of using business rules. Although this file uses manually created sql code, so it would be ideal to use the Django ORM in this file where possible. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing instructions
- Go to the forms of ExchangeOut, Disposal, Gift, and Deaccession.
- Play around with adding and deleting preparations
- Ensure Total Preps and Total Items display accurate values
Everything looks good! Total Preps and Total Items fields are properly calculated in each form.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing instructions
- Go to the forms of ExchangeOut, Disposal, Gift, and Deaccession.
- Play around with adding and deleting preparations
- Ensure Total Preps and Total Items display accurate values
Looks good! The fields are now functioning for each interaction.
This branch seems to be causing some sort of issue in the Fitz_NHMD_Oct_2023 database, but that is the only database I've found to be affected. I will go ahead and approve it, but could someone take a look and verify whether it is an issue specific to the database or the PR? This error is thrown when opening disposal forms in this branch:
Specify 7 Crash Report - 2024-05-16T21_28_17.993Z.txt
https://fitznhmdoct2023-issue-2521-2.test.specifysystems.org/specify/view/disposal/2/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Fixes #2521
Implements the calculations done in Specify 6 into Specify 7 as virtual fields for the following:
Exchange Out:
Disposal:
Gift:
Deaccession’s
Note: This PR is also taking the opportunity to take the existing hard-coded sql code in the
calculated_fields.py
file, and re-implementing it using the Django ORM.Checklist
and self-explanatory (or properly documented)
Testing instructions