← Back to Pull requests

[16.0][FIX] base_report_to_printer: compute the print action in the caller's context #512

Open
unknown opened this pull request with 153 lines diff across 1 files
View on GitHub
unknown unknown commented on Nov 20, 2026 16:03 UTC
Author

print_action_for_report_name() gets the report from _get_report_from_name(), which replaces the context with the user's context. behaviour() is then computed without the context of the caller: its own skip_printer_exception key never reaches it this way, and a module that passes a key to its behaviour() (e.g. to route prints by the operating unit of the printed records) has to replace print_action_for_report_name() instead of extending it.

The other callers of behaviour() already compute it in the caller's context: print_document() and print_document_client_action() call it on the report itself, and the print in _render_qweb_pdf() / _render_qweb_text() gets the report through _get_report(), which keeps the context. Only print_action_for_report_name() lost it.

This gives the report the caller's context back before behaviour() is computed. test_print_action_for_report_name_returns_if_report follows the new call (with_context() on the report); a new test checks that a key of the caller's context reaches behaviour().

AI assistance: the change and its tests were written with Claude Code; I reviewed and tested them (module test suite, pre-commit).

cc @rousseldenis @chienandalu

Diff: 153 lines (+114 / -39) across 1 files Reviewer: rousseldenis Review duration: 14451m
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.33) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.33 · 153 lines diff across 1 files
0.33
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
0.02
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
46%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
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
Shallow Review Depth shallow_review_depth
0.344
Diff Size diff_size
0.301
Real PR Conversation Timeline
1 comments
"Review active on #512"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 46.7% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 33.1% (LOW) · Higher = larger blast radius
33.1%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 46.7% · Lower = rushed or shallow review
46.7%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 17.6% · Safe to merge
17.6%