Hi,
We are creating Sample Requests via the API - and setting the “Date Sampled” field to some time in the future when that Sample will be collected and submitted to the lab.
The API allows this, but when I try and edit any Sample Header field (or just press the [save] button) in the frontend, the Date Sampled field throws the following error:
Date Sampled is after 2025-10-28 23:51, please correct.
where the date provided, as far as I can tell, only correlates with the created field when I interrogate the sample request via the api.
curl -X GET https://u:p@senhost/senaite/@@API/senaite/v1/AnalysisRequest?id=CWS-0052 | jq | grep -i "2025"
"created": "2025-10-28T23:51:01+00:00",
"getDateSampled": "2025-11-03T00:00:00+00:00",
"getPrioritySortkey": "3.2025-10-28T23:51:01+00:00",
"modified": "2025-10-19T22:35:14+00:00",
Our workflow goes:
- Create Work Order, including analysis request (created in Senaite, sets the
createddate and theDate Sampledfields) - Samples are collected, that day, or often days after and taken to the Lab
- Lab edits Sample headers in Senaite, adding sample to a Batch
→ This fails if the Date Sampled field is more recent than created field
We have had the users encounter a situation where the logic controlling these dates is in a locking cycle - eg
I press save on CWS-0027-R01
I fix (1), and press save - (2) still errors:
I fix error (2) - ie Date Sample Received is before 2025-11-03 00:00, please correct.
I now have a 3rd error - Date Sample Received is after 2025-10-29 02:50, please correct.
This is not resolvable - the date cannot be both before 2025-10-29 and after 03-11-2025, and each time I adjust it to fix one rule, it complains about the other.
Are you able to point me in the direction of where this interface/field logic is controlled (preferably without forking code), and where I can adjust/remove the restrictions?
Thanks in advance for any tips/pointers -
Bernie




