senaite.impress icon indicating copy to clipboard operation
senaite.impress copied to clipboard

Publication Specification doesn't work

Open siyamalan opened this issue 5 years ago • 5 comments

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

  1. Created a new sample request

  2. Assigned analysis specification

  3. Entered the results

  4. Published the report

  5. Changed the "publication specification" again

  6. Published the report again

Observed behaviour

After saving publication specification, the "specification" changed but the "Range" did not change image

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 avatar Jun 04 '19 11:06 siyamalan

@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

xispa avatar Jun 12 '19 18:06 xispa

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

image

siyamalan avatar Jun 21 '19 23:06 siyamalan

@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>

siyamalan avatar Jun 25 '19 12:06 siyamalan

@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 :)

  1. I can use Publication specification instead of Analysis specification to set specification while creating an analysis request
  2. Once results are entered and verified, specification (specs) in "View" does not change (regardless of publication specification)
  3. After verification, after publication, I can come back to any analysis request and publish report with any specification I require

siyamalan avatar Jul 14 '19 11:07 siyamalan

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.

xispa avatar Jul 16 '19 06:07 xispa