fix: Spanish frontend, wider columns, currency symbols, PDF download

PDF fix:
- Replace session-cookie auth with HTTP Basic Auth (username:api_key)
  which is natively supported by Odoo 17+ report endpoints
- Validate response is actually a PDF (%PDF header check) before serving
- Return a descriptive Spanish error if HTTP code != 200 or body is not PDF

Frontend → Spanish:
- All invoice template text in Spanish (Nº Factura, Vencimiento, etc.)
- All calendar/booking template text in Spanish
- Payment state labels: Pendiente / Parcial / En cobro / Pagado / Anulado
- "Vencida" badge for overdue invoices
- Error/notice messages in Spanish across both pages

Currency symbols:
- Add currency_symbol() helper mapping ISO codes to symbols
- EUR → €, USD → $, GBP → £, etc. (25 currencies mapped)

Column widths:
- Switch invoice table to table-layout:fixed with explicit column widths
- col-number: 180px nowrap so reference never wraps across lines
- Date/due/amount/status columns all fixed-width and nowrap
- Add .woodoo-nowrap utility class

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Malin
2026-04-01 17:30:10 +02:00
parent 38d1352e9a
commit 02c8fee174
5 changed files with 169 additions and 153 deletions

View File

@@ -56,18 +56,35 @@
width: 100%;
border-collapse: collapse;
font-size: .875rem;
table-layout: fixed; /* fixed layout so column widths are respected */
}
.woodoo-table th,
.woodoo-table td {
padding: 10px 12px;
padding: 10px 14px;
border-bottom: 1px solid #e5e7eb;
text-align: left;
vertical-align: middle;
overflow: hidden;
}
.woodoo-table th { background: #f9fafb; font-weight: 600; }
.woodoo-table tr:last-child td { border-bottom: none; }
.woodoo-table .woodoo-amount { text-align: right; font-variant-numeric: tabular-nums; }
.woodoo-table .woodoo-inv-number { font-weight: 600; }
.woodoo-table .woodoo-amount {
text-align: right;
font-variant-numeric: tabular-nums;
white-space: nowrap;
}
/* Invoice-specific column widths */
.woodoo-invoices-table .col-number { width: 180px; white-space: nowrap; font-weight: 600; }
.woodoo-invoices-table .col-date { width: 100px; white-space: nowrap; }
.woodoo-invoices-table .col-due { width: 130px; }
.woodoo-invoices-table .col-amount { width: 110px; text-align: right; }
.woodoo-invoices-table .col-balance { width: 130px; text-align: right; }
.woodoo-invoices-table .col-status { width: 100px; white-space: nowrap; }
.woodoo-invoices-table .col-download{ width: 70px; text-align: center; }
/* Utility: never wrap content in a cell */
.woodoo-nowrap { white-space: nowrap; }
.woodoo-overdue { color: #dc2626; font-weight: 600; }
/* ── Pagination ──────────────────────────────────────────── */