[19.0][FIX] sale_order_report_product_image: cap the printed picture size #410
All Vouch review confidence checks passed
Residual risk 0.25 = Change Risk (0.46) × (1 − Review Confidence (0.45)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.46 · 242 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 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
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.329
Real PR Conversation Timeline
1 comments
"Review active on #410"
general
weight: 0.35
alan196
Problem
The picture is printed with the raw content of
image_128and no size constraint:The
imagewidget serialises the field to a base64 data URI and emits a bare<img>tag;max_widthis not an option it supports, so it is silently ignored and the browser draws the picture at its natural size.This is harmless as long as
image_128really holds a 128px thumbnail. It is not for catalogues imported in a way that bypasses the ORM resize: we hit production orders whereimage_128stored 1920x1440 pictures, printed at 27cm wide. Every other column was pushed off the page, and the quotation came out with no description, no price and no total — one picture per page.Two smaller issues in the same template:
colspanof the standard template is not widened, so section and combo totals are printed one column to the left.Fix
<img>built withimage_data_uri(), capped withmax-width/max-height: 64px, which is whatmax_width: '64'was meant to do.70pxwidth and top-align it.section_name_colspanand the combocolspanby one.The generic icon shown when a product has no picture is unchanged: it goes through the
imagewidget on an empty field, which already returns a 64px placeholder URL.How to test
1. Put a product with a picture and a product without one on a quotation, with a section line.
2. Print the quotation: the picture is a small thumbnail, every column is readable, and the section total is aligned with the Amount column.
3. For the original bug, store a picture larger than 128px in
image_128directly (bypassing the ORM resize) and print again: the layout no longer breaks.