senaite.impress
senaite.impress copied to clipboard
Publication Specification doesn't work
Description
A single analysis specification can be assigned while creating analysis request.
The problem is that a single product tested by lab can have multiple specifications.
Being able to change "Publication Specification", hence having desired specifications in published report would absolutely solve this problem.
Reproduction guide
-
Created a new sample request
-
Assigned analysis specification
-
Entered the results
-
Published the report
-
Changed the "publication specification" again
-
Published the report again
Observed behaviour
After saving publication specification, the "specification" changed but the "Range" did not change
Expected behaviour
The Range should be different in published report
Versions
-
OS: Ubuntu Server 18.04.2 LTS
-
senaite.core:
1.3.1
-
senaite.impress:
1.2.0
-
senaite.core.listing:
master
-
senaite.core.supermodel:
master
@siyamalan which template are you using? Seems that Publication specification is taken into consideration in Default + MultiDefault templates already: https://github.com/senaite/senaite.impress/blob/master/src/senaite/impress/templates/reports/Default.pt#L268 and https://github.com/senaite/senaite.impress/blob/master/src/senaite/impress/templates/reports/MultiDefault.pt#L277
Thanks for the reply @xispa I have tried default+multi-default templates. My problem is "The range is unaffected by publication specification".
As shown in below picture, "Specification changes when I change publication specification but not the range. The publication specification I assign should also change the range
@xispa
default.pt or any other template is pulling only the analysis spec. They are not pulling publication spec
<td class="specs"> <span tal:condition="analysis/Uncertainty" tal:content="structure python:model.get_formatted_uncertainty(analysis)"></span> <span tal:content="python:'(RT)' if model.is_retest(analysis) else ''"></span> <span tal:content="python:model.get_formatted_specs(analysis)">50 - 60</span>
@xispa Getting the specs from publication specification instead of analysis Specification solved the above issue for me.
I made below changes and disabled the analysis specification completely, https://github.com/siyamalan/senaite.core/commit/e027647b879f20b4f70c26e56aac111a79cb3140
Below is how things are working for me :)
- I can use Publication specification instead of Analysis specification to set specification while creating an analysis request
- Once results are entered and verified, specification (specs) in "View" does not change (regardless of publication specification)
- After verification, after publication, I can come back to any analysis request and publish report with any specification I require
Funny. So with this change you've done , the analyses keep their own specs (e.g. defined on Sample creation), but the publication specs are displayed in the report.
Nevertheless, keep in mind that if you add a new analysis in that Sample, that new analysis will acquire the publication specifications, rather than the defaults. Also, when you do any of these:
- Reject/Invalidate the Sample
- Copy to new
- Create partitions
- Create a secondary
the specification of the resulting sample will be the primary's publication specification.