fix(sales): show product image on Stock Allocation backorder rows (qr71)#432
Merged
Merged
Conversation
…ted rows (qr71)
The Stock Allocation panel's Backorder/Unallocated rows rendered a hardcoded grey
placeholder instead of the product image, while line items (and the allocated-rows
and shipment-line sections) show images. Most visible on an order with no stock to
allocate (e.g. 163295), where every line falls into this list and shows grey.
The image data already flows in via lines={so.lines} (SoLineRow carries imageUrl);
the block just never read it. Add imageUrl to AllocationPanelLine and render the
same {imageUrl ? <img/> : <grey/>} pattern used by the adjacent allocation/shipment
rows.
Verified: type-check, eslint, next build, full unit suite (1887 pass / 0 fail).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Problem
On the sales order detail screen, the Stock Allocation panel's Backorder / Unallocated rows showed a hardcoded grey box instead of the product image — even though the line-items section, the allocated-rows section, and shipment-line rows all show product images.
Most visible on an order with no stock to allocate (e.g. order 163295, PROCESSING with 0 allocations): every line falls into the backorder/unallocated list, so each product appeared as a grey box despite having a valid image.
Root cause
The backorder block in
so-detail-client.tsxrendered a fixed<div className="w-8 h-8 rounded bg-muted" />and never read the line's image. The image data already flows in vialines={so.lines}(SoLineRowcarriesimageUrl), butAllocationPanelLinedidn't declare the field so it was dropped.Fix
imageUrl: string | nulltoAllocationPanelLine.{imageUrl ? <img/> : <grey/>}pattern already used by the adjacent allocated-rows and shipment-line sections.No data-layer changes —
getSalesOrderalready resolvesproduct.imageUrl ?? parent.imageUrlfor each line.Verification
npm run type-check✓npm run lint(target file) ✓npm run build✓ (compiled successfully)npm run test:unit✓ 1887 pass / 0 failCloses onetwo3d-ims-qr71
🤖 Generated with Claude Code