Commit Graph

5 Commits

Author SHA1 Message Date
Malin
c05433689e 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>
2026-04-01 17:43:39 +02:00
Malin
84e6195f3a fix: PDF via JSON-RPC render, full-width table with nowrap columns
PDF download:
- Drop HTTP Basic Auth approach (Odoo's /report/pdf/ endpoint rejects it)
- Call ir.actions.report.render_qweb_pdf() via the already-working
  authenticated JSON-RPC connection; returns base64-encoded PDF bytes
- Validate base64_decode result starts with %PDF before serving
- Descriptive Spanish error messages for each failure point

Table layout:
- Remove table-layout:fixed which was squashing columns into WC's
  ~650px content column
- Add min-width:820px so table never compresses below readable width
  (scrolls horizontally on small screens instead)
- .woodoo-invoices breaks out 100px into page margins on desktop
  (margin: 0 -100px; width: calc(100% + 200px)) for full-width feel
- Reverts to 100% width below 960px
- All key columns use white-space:nowrap + min-width so invoice
  reference, dates and amounts never wrap to multiple lines

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 17:34:34 +02:00
Malin
02c8fee174 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>
2026-04-01 17:30:10 +02:00
Malin
38d1352e9a fix: customer search & linking fully implemented
- Add ajax_search_wc_customers() – searches user_login, user_email,
  display_name AND first_name/last_name meta so any query returns hits
- Add ajax_unlink_customer() to remove an existing Odoo link
- Replace placeholder Customers tab with two-panel UI:
  Step 1 search WC customers → Step 2 search Odoo partners independently
  (WC email and Odoo email do not need to match)
- Results table shows current link status; inline Link/Unlink actions
  update the row in-place without page reload
- Admin JS fully wired: both search inputs respond to Enter key and button
- Add two-panel layout CSS and results table styles

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 17:18:01 +02:00
Malin
68c1ff4455 feat: initial WooDoo plugin – WooCommerce & Odoo 19 integration
- Odoo JSON-RPC client (no Composer, uses wp_remote_post)
- Admin settings page under WooCommerce with connection test
- Customer linking: search Odoo partners from WP user profile
- My Account: Odoo Invoices tab with PDF proxy download
- My Account: Book a Meeting tab (slot calculator + calendar.event)
- WC order → Odoo sale.order auto-sync on processing status
- Products matched by SKU; partner auto-created from billing info
- Uninstall cleanup (options, user meta, order meta, DB table)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 13:58:27 +02:00