odoo/tutorials#1314
Created by Rini Pillai (ripil)
Blocked
- Merge method
- Review
-
CI
- ci/style: (runtime 10s)
- ci/tutorial: (runtime 116s)
- label
- odoo-dev:19.0-picking-operation-report-ripil
- head
- 965bb43a9579eb432c745cc5d5f32904eb4303a5
| odoo/tutorials | |
|---|---|
| 19.0 | #1314 missing r+ |
| master |
[ADD] stock_picking: Repeat fields on Picking Operations Report PDF
Purpose
The task requested that specific header fields remain visible on subsequent pages when a Picking Operations PDF report spans multiple pages. Currently, these details are only visible on the first page when the table extends to the next page.
Changes Made
- Template Inheritance: Inherited the default template
stock.report_picking. - Header Relocation: Moved the
o_stock_report_header_rowelements into a<tr>inside the table header (<thead>). - Page Persistence: Using standard
wkhtmltopdfbehavior, placing this data inside the<thead>forces the browser engine to repeat the header fields automatically on every new page break.
Technical Details
Model: stock.picking
Custom Template: report_stockpicking_operations_inherited
Why
wkhtmltopdfrepeats any content wrapped inside a<thead>tag at the top of every new page when a table overflows. Moving the data here solves the client's request using standard HTML behavior without the need for complex custom logic.- Rather than rebuilding the layout this change targets the structure directly to ensure the data is present on page 2 and beyond.
Verification Steps
- Install Custom Picking Operation Report Header module from Apps.
- Go to Inventory -> Receipts.
- Select or create a picking record (stock.picking) with enough operations/lines to span across at least 2 pages.
- Click Print -> Picking Operations.
- Verify that the document fields repeat at the top of the second page exactly as they appear on the first page.