feat: invoice email resend, smaller table, column cleanup

Email resend (replaces broken PDF download):
- New AJAX action woodoo_send_invoice_email
- Finds Odoo invoice email template via ir.model.data (cached 24h)
  with fallback search on mail.template by model
- Calls mail.template.send_mail([template_id], invoice_id, force_send=True)
  via authenticated JSON-RPC — triggers Odoo to email the invoice
- Inline success/error row appears below the invoice row, auto-hides 6s
- Button shows "Enviando…" spinner state, resets on failure

Table columns:
- Remove "Saldo pendiente" column (was amount_residual)
- Rename "Total" → "Importe"
- min-width reduced to 700px now that there are 6 columns
- Font size reduced to .8rem for denser display

JS restructured so invoice email handler always runs (no early exit),
calendar handler only runs when WooDooCalendar data is present.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Malin
2026-04-01 17:43:39 +02:00
parent d1597731c5
commit c05433689e
4 changed files with 221 additions and 167 deletions

View File

@@ -72,9 +72,9 @@
}
.woodoo-table {
width: 100%;
min-width: 820px; /* never compress below this — scroll horizontally instead */
min-width: 700px; /* never compress below this — scroll horizontally instead */
border-collapse: collapse;
font-size: .875rem;
font-size: .8rem;
/* No table-layout:fixed — let the browser size columns to content */
}
.woodoo-table th,
@@ -92,13 +92,17 @@
white-space: nowrap;
}
/* Force key invoice columns to never wrap */
.woodoo-invoices-table .col-number { white-space: nowrap; font-weight: 600; min-width: 160px; }
.woodoo-invoices-table .col-date { white-space: nowrap; min-width: 90px; }
.woodoo-invoices-table .col-due { white-space: nowrap; min-width: 110px; }
.woodoo-invoices-table .col-amount { white-space: nowrap; min-width: 100px; text-align: right; }
.woodoo-invoices-table .col-balance { white-space: nowrap; min-width: 120px; text-align: right; }
.woodoo-invoices-table .col-status { white-space: nowrap; min-width: 90px; }
.woodoo-invoices-table .col-download{ min-width: 60px; text-align: center; }
.woodoo-invoices-table .col-number { white-space: nowrap; font-weight: 600; min-width: 160px; }
.woodoo-invoices-table .col-date { white-space: nowrap; min-width: 90px; }
.woodoo-invoices-table .col-due { white-space: nowrap; min-width: 110px; }
.woodoo-invoices-table .col-amount { white-space: nowrap; min-width: 100px; text-align: right; }
.woodoo-invoices-table .col-status { white-space: nowrap; min-width: 90px; }
.woodoo-invoices-table .col-action { min-width: 90px; text-align: center; }
/* Inline feedback rows (send invoice email) */
.woodoo-inline-msg td { font-size: .8rem; padding: 6px 16px; }
.woodoo-inline-msg--ok { color: #065f46; background: #ecfdf5; }
.woodoo-inline-msg--err { color: #991b1b; background: #fef2f2; }
/* Utility: never wrap content in a cell */
.woodoo-nowrap { white-space: nowrap; }