Commit Graph

10 Commits

Author SHA1 Message Date
Marc
70649c4b4e Fix P0-P2 bugs: sale.order M2M, display_name, DefaultGet
P0: Fix sale.order creation (was completely broken)
- Corrected M2M junction table name from sale_order_line_account_tax_rel
  to account_tax_sale_order_line_rel (ORM sorts alphabetically)
- Added fallback in BeforeCreate if sequence generation fails

P1: Add display_name as magic field on ALL models
- Added to addMagicFields() in pkg/orm/model.go (like Python BaseModel)
- Computed on-the-fly in Read() from recName field, no DB column
- Removed explicit display_name from res.partner (now auto-inherited)

P2: Add DefaultGet hooks for sale.order and purchase.order
- Sets company_id, currency_id, date_order/date_planned from environment
- Follows same pattern as account.move's DefaultGet

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 02:28:49 +02:00
Marc
1aa9351054 Make all user menu items functional
- res.users.action_get() RPC: returns preferences action (form dialog)
- /web/session/account endpoint: returns Odoo.com account URL
- /web/session/logout: clears session, redirects to login (was already done)
- support_url set to odoo.com/help (enables Help menu item)
- notification_type + display_switch_company_menu in session_info
- Image handler: path-style URL parsing for avatars

All user dropdown items now work:
  Help → opens odoo.com/help
  Shortcuts → opens command palette (client-side)
  My Preferences → opens user form dialog
  My Odoo.com Account → opens accounts.odoo.com
  Log out → clears session, redirects to login

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 01:43:26 +02:00
Marc
cc823d3310 Fix navbar: SVG logos, Settings menu, Logout handler
- Image handler now returns SVG placeholders for company logo and user
  avatars instead of broken 1x1 PNG (fixes yellow border in navbar)
- Supports both query-param (?model=&field=) and path-style URLs
  (/web/image/res.partner/2/avatar_128)
- Added Settings app menu with Users & Technical sub-menus
- Added actions for Settings (company form), Users list, Sequences
- Added /web/session/logout handler that clears session + cookie
- Added logout to middleware whitelist

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 01:31:37 +02:00
Marc
06cd2755bc Fix CSS loading: copy odoo_web.css to frontend, handle /odoo/ static paths
- Copy build/odoo_web.css to frontend/web/static/ so it's served correctly
- Handle /odoo/<addon>/static/ paths in static file handler (strip odoo/ prefix)
- Route /odoo/ paths with /static/ to static handler instead of webclient

All CSS now loads correctly: Bootstrap, FontAwesome, Odoo UI icons, modules.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 00:47:14 +02:00
Marc
8616def7aa Fix XML template xml:space injection for self-closing tags
The injectXmlSpacePreserve function was inserting the attribute AFTER
the self-closing slash in tags like <t t-name="foo"/>, producing
invalid XML: <t t-name="foo"/ xml:space="preserve">

Now correctly inserts before the slash:
<t t-name="foo" xml:space="preserve"/>

This fixes the "attributes construct error at column 33" that appeared
as a red banner in the Odoo webclient list view.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 00:25:29 +02:00
Marc
cead612975 Fix transpiler: function hoisting + re-export paths + DB seed
Transpiler fixes:
- export function declarations now use hoisted function syntax instead
  of var assignments, fixing modules that reference functions before
  their declaration (e.g., rpc.setCache before export function rpc)
- Re-export paths (export { X } from "./relative") now resolve to
  full module names in require() calls

DB seed fixes:
- Remove SQL comments from multi-value INSERT (pgx doesn't support --)
- Split multi-statement setval into individual Exec calls

Middleware:
- Add /web/database/* to public endpoint whitelist

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 00:15:54 +02:00
Marc
822a91f8cf Replace custom setup wizard with Database Manager (like Python Odoo)
Flow now mirrors Python Odoo exactly:
1. Empty DB → /web redirects to /web/database/manager
2. User fills: master_pwd, email (login), password, phone, lang, country, demo
3. Backend creates admin user, company, seeds chart of accounts
4. Auto-login → redirect to /odoo (webclient)

Removed:
- Custom /web/setup wizard
- Auto-seed on startup

Added:
- /web/database/manager (mirrors odoo/addons/web/controllers/database.py)
- /web/database/create (mirrors exp_create_database)
- Auto-login after DB creation with session cookie

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 23:38:16 +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
8741282322 Eliminate Python dependency: embed frontend assets in odoo-go
- Copy all OWL frontend assets (JS/CSS/XML/fonts/images) into frontend/
  directory (2925 files, 43MB) — no more runtime reads from Python Odoo
- Replace OdooAddonsPath config with FrontendDir pointing to local frontend/
- Rewire bundle.go, static.go, templates.go, webclient.go to read from
  frontend/ instead of external Python Odoo addons directory
- Auto-detect frontend/ and build/ dirs relative to binary in main.go
- Delete obsolete Python helper scripts (tools/*.py)

The Go server is now fully self-contained: single binary + frontend/ folder.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 23:09:12 +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