Skip to content

[17.0][FIX] ni_period, partner_age, survey_subject: forward-port of the 16.0 P0-4 fixes - #168

Merged
piruin merged 3 commits into
nirun-life:17.0from
wasud:17.0-fwd-p0-4
Oct 21, 2026
Merged

piruin merged 3 commits into
nirun-life:17.0from
wasud:17.0-fwd-p0-4

Conversation

@wasud

@wasud wasud commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Refs #135 · Forward-port of #166 (16.0) for the modules already merged on 17.0

Summary (TH)

forward-port การแก้บั๊ก P0-4 จาก #166 มาที่ 17.0 เฉพาะ 3 module ที่ merge บน 17.0 แล้ว ได้แก่ ni_period, partner_age และ survey_subject ส่วน ni_patient, ni_observation และ ni_questionnaire จะใส่ตอน rebase stack ที่รอ review อยู่ (#153–#161) PR นี้จึงไม่ไปแตะ stack นั้น

Changes

Module Fix Version
ni_period period_start_date has no default any more, so records created from code get the date of period_start, not today (#141 finding 5) 17.0.1.0.1
partner_age Removed tests/test_res_partner.py: never imported, a near copy of test_res_partner_age.py (tests only)
survey_subject "Answer Survey" button: not active instead of comparing with the string 'False' 17.0.1.0.1

The commits are the 16.0 ones from #166, with the manifest versions and the 17.0 view syntax adjusted.

Decisions to review

How tested

  • Fresh 17.0 DB without demo, ni_period, partner_age, survey_subject: 0 failed, 0 errors of 11 tests.
  • pre-commit clean on the changed files.

wasud added 3 commits October 19, 2026 14:59
period_start_date is a stored computed field with a default of today. On
create, a default counts as a given value, so the compute never runs: records
created from code (import, RPC) with only period_start got today as their start
date, and an encounter could then fail the end-date check when it was closed.

Drop the default. period_start already defaults to now, so a new record in the
form still starts today. The regression test is in ni_patient, which has the
first concrete model on the mixin.

Refs: nirun-life#135
tests/test_res_partner.py was not imported in tests/__init__.py, so it never
ran. It is a near copy of test_res_partner_age.py (the same cases, two
assertions in a different order), so there is nothing to merge.

Refs: nirun-life#135
The button's invisible condition compared active with the string 'False',
which never matches a boolean, so the button also showed on archived surveys.
Use not active.

Refs: nirun-life#135
@piruin
piruin merged commit 1a1848d into nirun-life:17.0 Oct 21, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants