Repository navigation
[16.0][FIX] ni_observation: compute each observation's own history - #185
Merged
Merged
Conversation
_compute_history searched with self.patient_id and self.type_id inside the loop, so reading the history of several observations at once (the latest-observation list, an export) gave every row the history of all their types together. The domain also compared type_id with a list using "=", which Odoo 17 and later log as a warning. Use rec and "in". Refs: nirun-life#181
This was referenced Oct 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #181 · Found by CI on #183 · Forward-ported in #182 (17.0), #183 (18.0), #184 (19.0)
Summary (TH)
แก้
_compute_historyของni.observationที่ใช้selfแทนrecใน loop เวลาอ่าน history ของหลาย observation พร้อมกัน (เช่น list ของ latest observation หรือ export) ทุกแถวจะได้ history ของทุก type ปนกัน และ domain ใช้=กับ list ซึ่ง Odoo 17 ขึ้นไปจะขึ้น warning จน CI fail (เจอบน #183)Changes
ni_observation_compute_historyusesrec.patient_idand("type_id", "in", rec.type_id.get_display_type().ids); newtests/test_observation_history.pyHow tested
-i ni_observation --test-tags /ni_observation: 0 failed, 0 errors of 34 tests.ni.observation(163, 164, 162) != ni.observation(163, 162)) and passes with it.pre-commitclean on the changed files.