Files
goodie/addons/l10n_de/models/l10n_de.go
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

100 lines
4.5 KiB
Go

package models
import "odoo-go/pkg/orm"
// initChartTemplate registers the German chart of accounts template model
// and defines the structure for loading SKR03/SKR04 seed data.
// Mirrors: odoo/addons/l10n_de/models/template_de_skr03.py
// odoo/addons/l10n_de/models/template_de_skr04.py
//
// German Standard Charts of Accounts (Standardkontenrahmen):
//
// SKR03 — organized by function (Prozessgliederungsprinzip):
// 0xxx Anlage- und Kapitalkonten (Fixed assets & capital accounts) — Aktiva
// 1xxx Finanz- und Privatkonten (Financial & private accounts) — Aktiva
// 2xxx Abgrenzungskonten (Accrual accounts) — Aktiva
// 3xxx Wareneingangskonten (Goods received / purchasing accounts) — GuV
// 4xxx Betriebliche Aufwendungen (Operating expenses) — GuV
// 5xxx (reserved)
// 6xxx (reserved)
// 7xxx Bestände an Erzeugnissen (Inventory of products) — GuV
// 8xxx Erlöskonten (Revenue accounts) — GuV
// 9xxx Vortrags- und statistische Konten (Carried-forward & statistical)
//
// SKR04 — organized by the balance sheet / P&L structure (Abschlussgliederungsprinzip):
// 0xxx Anlagevermögen (Fixed assets) — Aktiva
// 1xxx Umlaufvermögen (Current assets) — Aktiva
// 2xxx Eigenkapital (Equity) — Passiva
// 3xxx Fremdkapital (Liabilities) — Passiva
// 4xxx Betriebliche Erträge (Operating income) — GuV
// 5xxx Betriebliche Aufwendungen (Operating expenses, materials) — GuV
// 6xxx Betriebliche Aufwendungen (Operating expenses, personnel) — GuV
// 7xxx Weitere Erträge und Aufwendungen (Other income & expenses) — GuV
// 8xxx (reserved)
// 9xxx Vortrags- und statistische Konten (Carried-forward & statistical)
func initChartTemplate() {
// l10n_de.chart.template — Metadata for German chart of accounts templates.
// In Odoo, chart templates are loaded from data files (XML/CSV).
// This model holds template metadata; the actual account definitions
// would be loaded via seed data during module installation.
m := orm.NewModel("l10n_de.chart.template", orm.ModelOpts{
Description: "German Chart of Accounts Template",
Order: "name",
})
m.AddFields(
orm.Char("name", orm.FieldOpts{String: "Chart Name", Required: true, Translate: true}),
orm.Selection("chart_type", []orm.SelectionItem{
{Value: "skr03", Label: "SKR03 (Prozessgliederung)"},
{Value: "skr04", Label: "SKR04 (Abschlussgliederung)"},
}, orm.FieldOpts{String: "Chart Type", Required: true}),
orm.Many2one("company_id", "res.company", orm.FieldOpts{
String: "Company", Index: true,
}),
orm.Many2one("currency_id", "res.currency", orm.FieldOpts{String: "Currency"}),
orm.Boolean("visible", orm.FieldOpts{String: "Can be Visible", Default: true}),
)
}
// LoadSKR03 would load the SKR03 chart of accounts as seed data.
// In a full implementation, this reads account definitions and creates
// account.account records for the installing company.
//
// SKR03 key account ranges:
// 0100-0499 Immaterielle Vermögensgegenstände (Intangible assets)
// 0500-0899 Sachanlagen (Tangible fixed assets)
// 0900-0999 Finanzanlagen (Financial assets)
// 1000-1099 Kasse (Cash)
// 1200-1299 Bankkonten (Bank accounts)
// 1400-1499 Forderungen aus Lieferungen (Trade receivables)
// 1600-1699 Sonstige Forderungen (Other receivables)
// 1700-1799 Verbindlichkeiten aus Lieferungen (Trade payables)
// 1800-1899 Umsatzsteuer / Vorsteuer (VAT accounts)
// 3000-3999 Wareneingang (Goods received)
// 4000-4999 Betriebliche Aufwendungen (Operating expenses)
// 8000-8999 Erlöse (Revenue)
func LoadSKR03() {
// Seed data loading would be implemented here.
// Typically reads from embedded CSV/XML data files and calls
// orm create operations for account.account records.
}
// LoadSKR04 would load the SKR04 chart of accounts as seed data.
// SKR04 follows the balance sheet structure more closely.
//
// SKR04 key account ranges:
// 0100-0199 Immaterielle Vermögensgegenstände (Intangible assets)
// 0200-0499 Sachanlagen (Tangible fixed assets)
// 0500-0699 Finanzanlagen (Financial assets)
// 1000-1099 Kasse (Cash)
// 1200-1299 Bankkonten (Bank accounts)
// 1400-1499 Forderungen aus Lieferungen (Trade receivables)
// 2000-2999 Eigenkapital (Equity)
// 3000-3999 Fremdkapital (Liabilities)
// 4000-4999 Betriebliche Erträge (Operating income)
// 5000-6999 Betriebliche Aufwendungen (Operating expenses)
// 7000-7999 Weitere Erträge/Aufwendungen (Other income/expenses)
func LoadSKR04() {
// Seed data loading would be implemented here.
}