Skip to content
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

Do a deepcopy of interims instead of a shallow copy #1697

Merged
merged 3 commits into from
Nov 30, 2020
Merged

Conversation

xispa
Copy link
Member

@xispa xispa commented Nov 29, 2020

Description of the issue/feature this PR addresses

Adheres to #1696

--
I confirm I have tested this PR thoroughly and coded it according to PEP8
and Plone's Python styleguide standards.

When a value is set to an interim with choices, the listing initially
displays the value correctly because remains in `senaite.app.listing`
cache, but as soon as the list is filtered or the page refreshed, the
value is not displayed anymore. Listing grabs the interims from the
brain directly (`getInterimFields` metadata column), but even that
`set_field` endpoint from `senaite.app.listing` stores the value and
reindexes the analysis object, the value of the metadata field remains
unchanged.

This metadata column is only used in analysis listing and we already
wake-up the analysis object to grab other properties while rendering
the list, so there is no advantage at all of having this metadata
column.

Also, the fact that interims field is stored as a dict requires
special care when storing/updating this value in ZODB. Again, because
of the limited use of it, the complexity it entails is not worth.
@xispa xispa requested a review from ramonski November 29, 2020 22:45
@xispa xispa added the To port label Nov 29, 2020
@ramonski ramonski merged commit 6d662bd into 2.x Nov 30, 2020
@ramonski ramonski deleted the interims-choices-fix branch November 30, 2020 09:20
@xispa xispa removed the To port label Dec 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants