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>
This commit is contained in:
Marc
2026-03-31 23:38:16 +02:00
parent 9c444061fd
commit 822a91f8cf
6 changed files with 237 additions and 204 deletions

View File

@@ -66,9 +66,10 @@ func loadAssetList(name string, fs embed.FS) []string {
// handleWebClient serves the Odoo webclient HTML shell.
// Mirrors: odoo/addons/web/controllers/home.py Home.web_client()
func (s *Server) handleWebClient(w http.ResponseWriter, r *http.Request) {
// Check if setup is needed
// Check if database needs initialization
// Mirrors: odoo/addons/web/controllers/home.py ensure_db()
if s.isSetupNeeded() {
http.Redirect(w, r, "/web/setup", http.StatusFound)
http.Redirect(w, r, "/web/database/manager", http.StatusFound)
return
}