Description
When generating labels for stock/lots using the label feature in Twig mode, [[2D_CONTENT]] points to the part route (/scan/part/...) instead of the lot route (/scan/lot/...).
This happens with templates like:
{{ barcode_svg(placeholder('[[2D_CONTENT]]', element), 'QRCODE')|data_uri }}
Stock labels generated in Twig mode produce QR codes that open the wrong entity.
To Reproduce
Steps to reproduce the behavior:
- Open label generation.
- Select target type Part Lot / Stock.
- Use Twig mode and set line content to:
{{ barcode_svg(placeholder('[[2D_CONTENT]]', element), 'QRCODE')|data_uri }}
- Generate a label for a stock/lot entry.
- Scan the QR code.
QR redirects to the part (/scan/part/{id}).
Expected behavior
QR should redirect to the selected lot (/scan/lot/{id}).
Server Side
Additional context
For lot targets, placeholder resolution appears to fall back to the parent part too early for unknown placeholders.
As a result, [[2D_CONTENT]] gets resolved in part context before barcode-specific placeholder handling can use the lot context.
Description
When generating labels for stock/lots using the label feature in Twig mode, [[2D_CONTENT]] points to the part route (/scan/part/...) instead of the lot route (/scan/lot/...).
This happens with templates like:
Stock labels generated in Twig mode produce QR codes that open the wrong entity.
To Reproduce
Steps to reproduce the behavior:
QR redirects to the part (/scan/part/{id}).
Expected behavior
QR should redirect to the selected lot (/scan/lot/{id}).
Server Side
Additional context
For lot targets, placeholder resolution appears to fall back to the parent part too early for unknown placeholders.
As a result, [[2D_CONTENT]] gets resolved in part context before barcode-specific placeholder handling can use the lot context.