Commit Graph

9 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
6fd9cdea1b Simplify: O2M batch, domain dedup, db.go split, constants
Performance:
- O2M formatO2MFields: N+1 → single batched query per O2M field
  (collect parent IDs, WHERE inverse IN (...), group by parent)

Code dedup:
- domain.go compileSimpleCondition: 80 lines → 12 lines by delegating
  to compileQualifiedCondition (eliminates duplicate operator handling)
- db.go SeedWithSetup: 170-line monolith → 5 focused sub-functions
  (seedCurrencyAndCountry, seedCompanyAndAdmin, seedJournalsAndSequences,
  seedChartOfAccounts, resetSequences)

Quality:
- Magic numbers (80, 200, 8) replaced with named constants
- Net -34 lines

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 13:11:37 +02:00
Marc
70320b6b29 Simplify: batch M2O, deduplicate formatting, clean dead code
Code reuse:
- formatRecordsForWeb() consolidates 4-call formatting sequence
  (was duplicated in handleWebSearchRead + handleWebRead)
- ToRecordID() public alias for cross-package ID extraction

Performance:
- M2O NameGet now batched: collect all FK IDs per field, single
  NameGet per comodel instead of per-record (N+1 → 1)

Quality:
- normalizeNullFields: 30-line switch (all returning false) → 5 lines
- domain.go: remove unused _ = subParams assignment
- Net -14 lines

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 01:24:13 +02:00
Marc
15cccce6d5 Add stored form views, SO line compute, invoice line demo data
- Stored form views for CRM lead, purchase order, HR employee, project
- SO line price_subtotal compute (qty * price * (1 - discount/100))
- Invoice lines seeded for demo invoices (product + tax + receivable)
- O2M lines now visible in form views (sale orders + invoices)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 21:55:25 +02:00
Marc
fbe65af951 Fetch O2M child records in web_read/web_search_read responses
When a view specification requests O2M fields (e.g., order_line on
sale.order), the response now includes the child records as an array
of dicts. Searches child model by inverse_field = parent_id, reads
requested sub-fields, and formats M2O/dates/nulls on children too.

This makes inline list views in form notebooks show actual data:
- Sale order lines (product, qty, price) in sale.order form
- Invoice lines in account.move form
- Any O2M field with specification in get_views response

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 21:43:42 +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
06e49c878a Fix null→false, stock seed data, action_get on model, FK order
- Normalize null DB values to false (Odoo convention) in web_search_read
  and web_read responses
- Seed stock reference data: 6 locations, 1 warehouse, 3 picking types
- Fix FK order: warehouse must be created before picking types
- Move action_get from hardcoded dispatcher to res.users RegisterMethod
- Add action_res_users_my (ID 103) to seedActions
- Remove hardcoded action_get case from dispatchORM

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 02:52:15 +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