-
-
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
Adding Analyses to an existing Worksheet in a non-open status fails #1281
Comments
Seems like |
And we always try to do a rollback on analysis assignment here: https://github.com/senaite/senaite.core/blob/master/bika/lims/content/worksheet.py#L207 I think we can safely remove this check if we add a condition in analysis guard to not allow the assignment if the current worksheet is closed or verified. |
Umm, somehow, not allowing to add analyses when the worksheet is in But if I remove the remaining analysis, the status of the Worksheet is promoted
to `to_be_verified`, cause all the analyses assigned are in this state:
>>> fe = filter(lambda an: an.getKeyword() == "Fe", analyses)[0]
>>> worksheet.removeAnalysis(fe)
>>> fe.getWorksheet() is None
True
>>> api.get_workflow_status_of(fe)
'unassigned'
>>> api.get_workflow_status_of(worksheet)
'to_be_verified'
And now, I cannot add analyses anymore:
>>> worksheet.addAnalysis(fe)
>>> filter(lambda an: an.getKeyword() == "Fe", worksheet.getAnalyses())
[]
>>> fe.getWorksheet() is None
True
>>> api.get_workflow_status_of(fe)
'unassigned'
Neither remove:
>>> worksheet.removeAnalysis(au)
>>> map(lambda an: an.getKeyword(), worksheet.getAnalyses())
['Au']
>>> au.getWorksheetUID() == api.get_uid(worksheet)
True
>>> api.get_workflow_status_of(au)
'to_be_verified' So, what do you suggest? |
Steps to reproduce
1- Open an already created Worksheet with assigned Analyses.
2- Open the label to add more analyses to the worksheet.
3- Select an analysis and assign it to the worksheet
Current behavior
The new assigned analyses are not assigned to the worksheet and no error is displayed.
Expected behavior
The new assigned analyses to be assigned to the worksheet
Screenshot (optional)
First screen of the Worksheet:
Analyses selected:
Worksheet/Analyses view after clicking on "assign":
The text was updated successfully, but these errors were encountered: