Commit Graph

11 Commits

Author SHA1 Message Date
Marc
66383adf06 feat: Portal, Email Inbound, Discuss + module improvements
- Portal: /my/* routes, signup, password reset, portal user support
- Email Inbound: IMAP polling (go-imap/v2), thread matching
- Discuss: mail.channel, long-polling bus, DM, unread count
- Cron: ir.cron runner (goroutine scheduler)
- Bank Import, CSV/Excel Import
- Automation (ir.actions.server)
- Fetchmail service
- HR Payroll model
- Various fixes across account, sale, stock, purchase, crm, hr, project

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 18:41:57 +02:00
Marc
2c7c1e6c88 PDF invoice reports + SMTP email sending
PDF Reports:
- Professional invoice HTML renderer (company header, partner address,
  styled line items, totals, Odoo-purple branding, A4 @page CSS)
- wkhtmltopdf installed in Docker runtime stage for real PDF generation
- Print button on invoice form (opens PDF in new tab)
- Exported HtmlToPDF/RenderInvoiceHTML for cross-package use

SMTP Email:
- SendEmail + SendEmailWithAttachments with MIME multipart support
- Base64 file attachments
- Config via ODOO_SMTP_HOST/PORT/USER/PASSWORD/FROM env vars
- LoadSMTPConfig helper, nil auth for relay servers

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 13:58:19 +02:00
Marc
0a76a2b9aa Account module massive expansion: 2499→5049 LOC (+2550)
New models (12):
- account.asset: depreciation (linear/degressive), journal entry generation
- account.edi.format + account.edi.document: UBL 2.1 XML e-invoicing
- account.followup.line: payment follow-up escalation levels
- account.reconcile.model + lines: automatic bank reconciliation rules
- crossovered.budget + lines + account.budget.post: budgeting system
- account.cash.rounding: invoice rounding (UP/DOWN/HALF-UP)
- account.payment.method + lines: payment method definitions
- account.invoice.send: invoice sending wizard

Enhanced existing:
- account.move: action_reverse (credit notes), access_url, invoice_has_outstanding
- account.move.line: tax_tag_ids, analytic_distribution, date_maturity, matching_number
- Entry hash chain integrity (SHA-256, secure_sequence_number)
- Report HTML rendering for all 6 report types
- res.partner extended with followup status + overdue tracking

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 21:59:50 +02:00
Marc
b8fa4719ad Deep dive: Account, Stock, Sale, Purchase — +800 LOC business logic
Account:
- Multi-currency: company_currency_id, amount_total_signed
- Lock dates on res.company (period, fiscal year, tax) + enforcement in action_post
- Recurring entries: account.move.recurring with action_generate (copy+advance)
- Tax groups: amount_type='group' computes child taxes with include_base_amount
- ComputeTaxes batch function, findTaxAccount helper

Stock:
- Lot/Serial tracking: enhanced stock.lot with expiration dates + qty compute
- Routes: stock.route model with product/category/warehouse selectable flags
- Rules: stock.rule model with pull/push/buy/manufacture actions + procure methods
- Returns: action_return on picking (swap locations, copy moves)
- Product tracking extension (none/lot/serial) + route_ids M2M

Sale:
- Pricelist: get_product_price with fixed/percentage/formula computation
- Margin: purchase_price, margin, margin_percent on line + order totals
- Down payments: action_create_down_payment (deposit invoice at X%)

Purchase:
- 3-way matching: action_create_bill now updates qty_invoiced on PO lines
- Purchase agreements: purchase.requisition + line with state machine

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 19:05:39 +02:00
Marc
d9171191af Deepen Account + Stock modules significantly
Account (+400 LOC):
- Accounting reports: Trial Balance, Balance Sheet, Profit & Loss,
  Aged Receivable/Payable, General Ledger (SQL-based generation)
- account.report + account.report.line models
- Analytic accounting: account.analytic.plan, account.analytic.account,
  account.analytic.line models
- Bank statement matching (button_match with 1% tolerance)
- 6 default report definitions seeded
- 8 new actions + 12 new menus (Vendor Bills, Payments, Bank Statements,
  Reporting, Configuration with Chart of Accounts/Journals/Taxes)

Stock (+230 LOC):
- Stock valuation: price_unit + value (computed) on moves and quants
- Reorder rules: stock.warehouse.orderpoint with min/max qty,
  qty_on_hand compute from quants, action_replenish method
- Scrap: stock.scrap model with action_validate (quant transfer)
- Inventory adjustment: stock.quant.adjust wizard (set qty directly)
- Scrap location seeded

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 14:57:33 +02:00
Marc
cc1f150732 Deepen all business modules: methods, validations, workflows
Account:
- action_post: partner validation, line count check, sequence number
  assignment (JOURNAL/YYYY/NNNN format)
- action_register_payment: opens payment wizard from invoice
- remove_move_reconcile: undo reconciliation, reset residuals
- Register Payment button in invoice form (visible when posted+unpaid)

Sale:
- action_cancel: cancels linked draft invoices + SO state
- action_draft: reset cancelled SO to draft
- action_view_invoice: navigate to linked invoices
- Cancel/Reset buttons in form view header

Purchase:
- button_draft: reset cancelled PO to draft
- action_create_bill already existed

Stock:
- action_cancel on picking: cancels moves + picking state

CRM:
- action_set_won_rainbowman: sets Won stage + rainbow effect
- convert_opportunity: lead→opportunity type switch

HR:
- hr.contract model (name, employee, wage, dates, state)

Project:
- action_blocked on task (kanban_state)
- Task stage seed data (New, In Progress, Done, Cancelled)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 00:58:01 +02:00
Marc
0143ddd655 Fix reconciliation: use SQL float8 cast for numeric fields
pgx v5 returns PostgreSQL numeric as pgtype.Numeric (not float64)
when scanning into interface{}. The reconcile method now reads line
data directly via SQL with ::float8 casts instead of ORM Read().

Verified end-to-end: Invoice receivable (1000) + Payment credit (-1000)
→ partial_reconcile created → residuals zeroed → full_reconcile created
→ invoice payment_state = 'paid'.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 00:32:38 +02:00
Marc
5d48737c9d Implement core business logic depth: reconciliation, quants, invoicing
Account Reconciliation Engine:
- reconcile() method on account.move.line matches debit↔credit lines
- Creates account.partial.reconcile records for each match
- Detects full reconciliation (all residuals=0) → account.full.reconcile
- updatePaymentState() tracks paid/partial/not_paid on invoices
- Payment register wizard now creates journal entries + reconciles

Stock Quant Reservation:
- assignMove() reserves products from source location quants
- getAvailableQty() queries unreserved on-hand stock
- _action_confirm → confirmed + auto-assigns if stock available
- _action_assign creates stock.move.line reservations
- _action_done updates quants (decrease source, increase dest)
- button_validate on picking delegates to move._action_done
- Clears reserved_quantity on completion

Sale Invoice Creation (rewritten):
- Proper debit/credit/balance on invoice lines
- Tax computation from SO line M2M tax_ids (percent/fixed/division)
- Revenue account lookup (SKR03 8300 with fallbacks)
- amount_residual set on receivable line (enables reconciliation)
- qty_invoiced tracking on SO lines
- Line amount computes now include tax in price_total

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 23:25:32 +02:00
Marc
b57176de2f Bring odoo-go to ~70%: read_group, record rules, admin, sessions
Phase 1: read_group/web_read_group with SQL GROUP BY, aggregates
  (sum/avg/min/max/count/array_agg/sum_currency), date granularity,
  M2O groupby resolution to [id, display_name].

Phase 2: Record rules with domain_force parsing (Python literal parser),
  global AND + group OR merging. Domain operators: child_of, parent_of,
  any, not any compiled to SQL hierarchy/EXISTS queries.

Phase 3: Button dispatch via /web/dataset/call_button, method return
  values interpreted as actions. Payment register wizard
  (account.payment.register) for sale→invoice→pay flow.

Phase 4: ir.filters, ir.default, product fields expanded, SO line
  product_id onchange, ir_model+ir_model_fields DB seeding.

Phase 5: CSV export (/web/export/csv), attachment upload/download
  via ir.attachment, fields_get with aggregator hints.

Admin/System: Session persistence (PostgreSQL-backed), ir.config_parameter
  with get_param/set_param, ir.cron, ir.logging, res.lang, res.config.settings
  with company-related fields, Settings form view. Technical menu with
  Views/Actions/Parameters/Security/Logging sub-menus. User change_password,
  preferences. Password never exposed in UI/API.

Bugfixes: false→nil for varchar/int fields, int32 in toInt64, call_button
  route with trailing slash, create_invoices returns action, search view
  always included, get_formview_action, name_create, ir.http stub.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 19:26:08 +02:00
Marc
9c444061fd Backend improvements: views, fields_get, session, RPC stubs
- Improved auto-generated list/form/search views with priority fields,
  two-column form layout, statusbar widget, notebook for O2M fields
- Enhanced fields_get with currency_field, compute, related metadata
- Fixed session handling: handleSessionInfo/handleSessionCheck use real
  session from cookie instead of hardcoded values
- Added read_progress_bar and activity_format RPC stubs
- Improved bootstrap translations with lang_parameters
- Added "contacts" to session modules list

Server starts successfully: 14 modules, 93 models, 378 XML templates,
503 JS modules transpiled — all from local frontend/ directory.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 23:16:26 +02:00
Marc
0ed29fe2fd Odoo ERP ported to Go — complete backend + original OWL frontend
Full port of Odoo's ERP system from Python to Go, with the original
Odoo JavaScript frontend (OWL framework) running against the Go server.

Backend (10,691 LoC Go):
- Custom ORM: CRUD, domains→SQL with JOINs, computed fields, sequences
- 93 models across 14 modules (base, account, sale, stock, purchase, hr,
  project, crm, fleet, product, l10n_de, google_address/translate/calendar)
- Auth with bcrypt + session cookies
- Setup wizard (company, SKR03 chart, admin, demo data)
- Double-entry bookkeeping constraint
- Sale→Invoice workflow (confirm SO → generate invoice → post)
- SKR03 chart of accounts (110 accounts) + German taxes (USt/VSt)
- Record rules (multi-company filter)
- Google integrations as opt-in modules (Maps, Translate, Calendar)

Frontend:
- Odoo's original OWL webclient (503 JS modules, 378 XML templates)
- JS transpiled via Odoo's js_transpiler (ES modules → odoo.define)
- SCSS compiled to CSS (675KB) via dart-sass
- XML templates compiled to registerTemplate() JS calls
- Static file serving from Odoo source addons
- Login page, session management, menu navigation
- Contacts list view renders with real data from PostgreSQL

Infrastructure:
- 14MB single binary (CGO_ENABLED=0)
- Docker Compose (Go server + PostgreSQL 16)
- Zero phone-home (no outbound calls to odoo.com)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 01:45:09 +02:00