[19.0] [FIX] base_comment_template: use loop variable in compute methods #1254
All Vouch review confidence checks passed
Residual risk 0.13 = Change Risk (0.33) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.33 · 157 lines diff across 1 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.303
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #1254"
general
weight: 0.35
pedrobaeza
Bug found during review of #1219 (migration to 20.0): inside
_compute_no_recordand_compute_base_comment_template_fieldsinwizard/base_comment_template_preview.py, the code readsself.base_comment_template_idfrom inside afor preview in self:/for wizard in self:loop. This silently takesself[0]and causes computed fields on other records to be wrong on multi-record browse.The fix uses the loop variable (
preview/wizard) consistently. The file is identical on 16.0 / 17.0 / 18.0 / 19.0 / 20.0, so the same two-line change applies verbatim on each branch.Companion PRs
Checklist
python -m py_compilepasses locally on all branchesTests
The existing test calls
_compute_no_recordon a single-record recordset, so it does not exercise the bug — behavior unchanged for the covered case. Happy to add a multi-record test if maintainers want.Original discovery
https://github.com/OCA/reporting-engine/pull/1219