From d6d6249857d09d692b58410397420683aee3fd93 Mon Sep 17 00:00:00 2001 From: gsinghpal Date: Thu, 21 May 2026 04:47:45 -0400 Subject: [PATCH] changes --- fusion_plating/CLAUDE.md | 3 +- .../__manifest__.py | 2 +- .../views/sale_order_views.xml | 74 +-- .../fusion_plating_logistics/__manifest__.py | 2 +- .../models/fp_delivery.py | 52 +++ .../views/fp_delivery_views.xml | 24 + .../fusion_plating_reports/__manifest__.py | 2 +- .../report/report_actions.xml | 36 ++ .../report/report_fp_packing_slip.xml | 442 +++++++++++------- .../report/report_fp_sale.xml | 274 +++++++---- 10 files changed, 610 insertions(+), 301 deletions(-) diff --git a/fusion_plating/CLAUDE.md b/fusion_plating/CLAUDE.md index f1ee281e..81516dde 100644 --- a/fusion_plating/CLAUDE.md +++ b/fusion_plating/CLAUDE.md @@ -29,7 +29,7 @@ Fusion Plating is a multi-module Odoo 19 ERP for electroless nickel plating and | **Report border rendering** | After two failed attempts (px→mm conversion + dpi bump; then `border-collapse: separate` single-side-per-cell), settled on **`border-collapse: collapse` + longhand borders + `background-clip: padding-box`**. Verticals are a hair softer than horizontals on entech wkhtmltopdf — accepted as the lesser evil vs misaligned tables. See rule 14a, last paragraph. **Don't retry the single-side pattern.** | `fusion_plating_reports` | | **Page-break-inside: avoid placement** | When a long QWeb report dumps content into multi-page PDFs via wkhtmltopdf, the company header (rendered as `--header-html`) can overlap body content if a page break lands mid-row in a table. **Apply `page-break-inside: avoid` to `` elements** (and to wrapper `
`s that wrap whole logical sections like signature blocks), not to ``. On entech wkhtmltopdf, `
`-level `page-break-inside` is unreliable when the table is long enough to definitely break; per-row is honoured. Pattern: keep individual readings/rows together so the wkhtmltopdf header zone never overlaps mid-row content. Wrap the larger logical block (cert thickness section, signature + certification statement) in `
` to keep it together when it fits and naturally wrap to a fresh page when it doesn't. | `fusion_plating_reports/report/report_coc.xml` | | **`opacity` + `italic` muted text renders jagged on entech wkhtmltopdf** | The obvious pattern for a subtle footnote — `font-style: italic; opacity: 0.7;` (used by `.fp-coc .small-label`) — produces washed-out, jagged characters that look "broken" or "messed up" on the printed PDF. Visually it reads as garbled text even though the source is clean. **Use solid grey (`color: #555`) at normal weight instead** for muted secondary text. Same workaround applies to any `opacity`-driven greyed-out element bound for wkhtmltopdf. The existing `.small-label` class still exists for legacy callers but new code should prefer an explicit `color:` style. | `fusion_plating_reports` | -| **wkhtmltopdf header overlap — paperformat.margin_top, NOT body padding-top** | The wkhtmltopdf header zone is sized by `report.paperformat.margin_top` (and `header_spacing`). If the `web.external_layout` header (logo + address etc.) renders ~28mm tall but paperformat reserves only 8mm, page 2+ has the header bleeding over body content (the overlap shows up as the company logo printed *on top of* the signature, readings table, etc.). The anti-pattern is "fix" it by adding `padding-top: 50mm` to the body wrapper — this only pads page 1 (single one-shot padding) and does nothing for subsequent pages, while also wasting 50mm of usable space on page 1. **Right fix:** size `paperformat.margin_top` to the actual rendered header height, then drop body `padding-top` to a tiny visual gap (~5mm). Each report can have its own paperformat — `report_coc_en` / `report_coc_fr` use "Fusion Plating CoC" (id 13); the legacy `report_coc` uses "A4 Landscape (Fusion Plating)" (id 12). Update the right one and don't bleed changes across reports. | `fusion_plating_reports`, `report.paperformat` | +| **wkhtmltopdf header overlap — paperformat.margin_top, NOT body padding-top** | The wkhtmltopdf header zone is sized by `report.paperformat.margin_top` (and `header_spacing`). If the `web.external_layout` header (logo + address etc.) renders ~28mm tall but paperformat reserves only 8mm, page 2+ has the header bleeding over body content (the overlap shows up as the company logo printed *on top of* the signature, readings table, etc.). The anti-pattern is "fix" it by adding `padding-top: 50mm` to the body wrapper — this only pads page 1 (single one-shot padding) and does nothing for subsequent pages, while also wasting 50mm of usable space on page 1. **Right fix:** size `paperformat.margin_top` to the actual rendered header height, then drop body `padding-top` to a tiny visual gap (~5mm). Each report can have its own paperformat — `report_coc_en` / `report_coc_fr` use "Fusion Plating CoC" (id 13); the legacy `report_coc` uses "A4 Landscape (Fusion Plating)" (id 12). Update the right one and don't bleed changes across reports. **Corollary — don't use negative `margin-top` to "tighten" the gap** (e.g. `.my-page { margin-top: -10px; }` to pull the H1 up under the header). The body wrapper sits at the bottom edge of the reserved margin_top zone; any negative margin pushes content INTO the header band, where wkhtmltopdf clips the top of glyphs (looks like the title is half-eaten). If the gap really feels too big, shrink the title font instead, or reduce `paperformat.margin_top` so the entire header zone is shorter. **For customer-facing portrait reports** (SO confirmation, quote, invoice, packing slip, BoL) the canonical compact paperformat is `fusion_plating_reports.paperformat_fp_a4_portrait` (margin_top=22mm, header_spacing=3mm, keeps the standard header band). Bind it via `` rather than creating yet-another-one. **Two compounding-padding traps to be aware of:** (1) Odoo's `.page` class has `padding: 1cm` baked in (Bootstrap-derived). If you wrap your body in `
` AND add a body `padding-top: 15mm`, you get the paperformat margin_top + 10mm Odoo + 15mm yours = ~65mm of dead space above the title. To remove the .page contribution without losing its left/right padding, override only the top: `.fp-report.fp-sale .page { padding-top: 0 !important; }`. CoC sidesteps this by NOT using an inner `.page` div — it wraps directly in `
` and puts padding on that. (2) The base `.fp-report table.bordered th, .fp-report table.bordered td` rule applies borders explicitly, BUT a separate cascade still bleeds borders onto NESTED `
` elements even when the inner table has no `.bordered` class — `border: 0 !important` on the cells does NOT reliably override it (some wkhtmltopdf rendering paths still draw the lines). **Don't use a `
` for non-bordered layouts** like a title/barcode strip; use `
` + `float: right` / flexbox instead. Saves an hour of CSS specificity arguments with wkhtmltopdf. (3) **CSS comments inside QWeb ` + + + + + + + + + + + @@ -16,6 +155,25 @@ + + + + + + + + + + + + +
@@ -24,92 +182,67 @@ - -
- - - - - - + +
FROMSHIP TO
- - - - -
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - +
SHIP DATESOURCEOPERATIONCARRIER
- - + + + + + + + + + - -
- - + +
- - - - - + + + - - - - - - - - - - + + + + +
PART NUMBERDESCRIPTIONQTYUOMLOT / SERIAL + Ship ViaMode d'expédition + + Shipping DateDate d'expédition + + Tracking #N° de suivi +
- - - - - - - - -
-
-
-
+ + + + +
+ + + + + + + + + + + +
@@ -118,21 +251,8 @@
- -
-
-
-
-
Shipper (Signature / Date)
-
-
-
-
-
-
Receiver (Signature / Date)
-
-
-
+ +
@@ -149,6 +269,18 @@ + + + + + + + + + + + +
@@ -157,104 +289,67 @@ - - - - - - - - + +
FROMSHIP TO
- -
-
-
+
+ + + + -
-
+
+ + + +
- - + +
- - - - - + + + - - - - + - +
SHIP DATESOURCEOPERATIONCARRIERTRACKING REF + Ship ViaMode d'expédition + + Shipping DateDate d'expédition + + Tracking #N° de suivi +
- - + + + - - - - - - - - +
- - - - - - - - - - - - - - - - - - - - - - - - - - -
PART NUMBERDESCRIPTIONORDEREDDONEUOMLOT / SERIALNOTES
- - - - - - - - - - -
-
-
-
-
+ + + + + + + + + + + @@ -264,21 +359,8 @@
- -
-
-
-
-
Shipper (Signature / Date)
-
-
-
-
-
-
Receiver (Signature / Date)
-
-
-
+ +
diff --git a/fusion_plating/fusion_plating_reports/report/report_fp_sale.xml b/fusion_plating/fusion_plating_reports/report/report_fp_sale.xml index 101b2e80..cb2be321 100644 --- a/fusion_plating/fusion_plating_reports/report/report_fp_sale.xml +++ b/fusion_plating/fusion_plating_reports/report/report_fp_sale.xml @@ -11,28 +11,99 @@ + + +