senaite.core
senaite.core copied to clipboard
Interim fields with same field name but different keyword appear misleaded in manage results
Steps to reproduce
- Create a Calculation "Cloro libre" with these interims:
Keyword | Field Title | Default value | Unit |
---|---|---|---|
V0 | Vol | 100.0 | mL |
C3 | c[Cl2] | mmol/L | |
V3 | Vol (NH4)2Fe(SO4)2·6H2O | mL | |
V5 | Vol Mn+ | 0.0 |
And with this calculation formula:
([C3]*([V3]-[V5]))/[V0]
- Create a Calculation "Cloro total" with these interims:
Keyword | Field Title | Default value | Unit |
---|---|---|---|
V0 | Vol | 100.0 | mL |
C3 | c[Cl2] | mmol/L | |
V4 | Vol (NH4)2Fe(SO4)2·6H2O | mL | |
V5 | Vol Mn+ | 0.0 |
And with this calculation formula:
([C3]*([V4]-[V5]))/[V0]
Note that both Calculation differs in the the keyword for interim Vol (NH4)2Fe(SO4)2·6H20
. V3
is used in the first calculation and V4
is used in the second.
- Create an Analysis Service "Cloro libre" with keyword
Cl_libre
and withCloro libre
calculation assigned. - Create an Analysis Service "Cloro total" with keyword
Cl_total
and withCloro total
calculation assigned. - Create a Calculation "Cloro combinado" without interims, but with this formula:
([Cl_total]-[Cl_libre])
-
Create an Analysis Service "Cloro combinado" with keyword
Cl_combinado
and withCloro combinado
calculation assigned -
Create an Analysis Request with
Cloro libre
,Cloro combinado
andCloro total
analyses. -
Receive the Analysis Request
-
Create a Worksheet and assign the analyses
-
In manage results view, interim fields columns for
Vol (NH4)2Fe(SO4)2·6H20
appear misleaded, although their field names are the same (but different keyword). See screenshot below.
Current behavior
Interim fields with same title (but different keyword) and same order appear separated in 2 different columns.
Expected behavior
Interim fields with same title (also if different keyword) and same order appear in the same column.
Screenshot (optional)
Do I understand that right, that two input fields should be rendered in that case for the Vol (NH4)2Fe(SO4)2·6H2O
cell?
Ah, sorry, got it. They should appear aligned in two rows...
IMO the behavior is correct, because V3
and V4
are different primary keys and thus, are rendered in different cells.
Trying to merge the fields into a single cell is also technically not possible, because the columns match exactly with the interim keyword here: https://github.com/senaite/senaite.core/blob/master/bika/lims/browser/analyses/view.py#L542
Therefore, it is not possible to add a column for both keywords, e.g. V3V4
, because then it wouldn't match anymore with the input fields for the interims:

Leaving this one open until senaite.core 1.3.0
The correct behaviour would be for the 'Cloro total' analysis service to fail to save, with a message reading "Validation failed: column title 'Vol (NH4)2Fe(SO4)2·6H2O' must have keyword 'V3'". The validator is failing.