-
-
Notifications
You must be signed in to change notification settings - Fork 144
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
Fix samples are indicated as late when Turnaround Time is zero #2569
base: 2.x
Are you sure you want to change the base?
Fix samples are indicated as late when Turnaround Time is zero #2569
Conversation
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.
Many thanks @DanE417 for your suggestion. I think you can make it way simpler, please check the comments!
Also, please add an entry at the top of the changelog: https://github.com/senaite/senaite.core/blob/2.x/CHANGES.rst
src/senaite/core/tests/doctests/AnalysisTurnaroundTimeForZeroValues.rst
Outdated
Show resolved
Hide resolved
src/senaite/core/tests/doctests/AnalysisTurnaroundTimeForZeroValues.rst
Outdated
Show resolved
Hide resolved
src/senaite/core/tests/doctests/AnalysisTurnaroundTimeForZeroValues.rst
Outdated
Show resolved
Hide resolved
src/senaite/core/tests/doctests/AnalysisTurnaroundTimeForZeroValues.rst
Outdated
Show resolved
Hide resolved
Hi @DanE417 , any news regarding this PR? |
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.
Thanks @DanE417 , everything looks ok now, but before we can merge you need to do the following:
- Make the tests pass (see comment below)
- Add an upgrade step to:
The upgrade step is necessary because existing samples and analyses will still be indicated as late in listings. Reason is that they use the value returned for getDueDate
metadata to render the late icon. Likewise, the getDueDate
index is used in searches and to sort them in listings too.
The issue only happens for services their TAT is 0 days, 0 hours and 0 minutes. Therefore, the upgrade step will be faster if you search only for analyses their service uid is one of those. You can use the getServiceUID
index to search analyses by service uid.
>>> date_future = (DateTime() + 5).strftime("%Y-%m-%d") | ||
>>> client = api.create(portal.clients, "Client", Name="Happy Hills", ClientID="HH", MemberDiscountApplies=True) | ||
>>> contact = api.create(client, "Contact", Firstname="Rita", Lastname="Mohale") | ||
>>> sampletype = api.create(bikasetup.bika_sampletypes, "SampleType", title="Water", Prefix="W") |
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.
Note test is failing now because of #2584 . Use setup.sampletypes
instead of bikasetup.bika_sampletypes
Description of the issue/feature this PR addresses
Linked issue: #2568
Current behavior before PR
Samples are shown as late when having a Turnaround Time of zero.
Desired behavior after PR is merged
Samples are not shown as late when having a Turnaround Time of zero.
--
I confirm I have tested this PR thoroughly and coded it according to PEP8
and Plone's Python styleguide standards.