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>
This commit is contained in:
@@ -612,6 +612,12 @@ func (s *Server) dispatchORM(env *orm.Environment, params CallKWParams) (interfa
|
||||
}
|
||||
return nameResult, nil
|
||||
|
||||
case "read_progress_bar":
|
||||
return map[string]interface{}{}, nil
|
||||
|
||||
case "activity_format":
|
||||
return []interface{}{}, nil
|
||||
|
||||
case "action_archive":
|
||||
ids := parseIDs(params.Args)
|
||||
if len(ids) > 0 {
|
||||
@@ -754,13 +760,20 @@ func (s *Server) handleAuthenticate(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
func (s *Server) handleSessionInfo(w http.ResponseWriter, r *http.Request) {
|
||||
s.writeJSONRPC(w, nil, map[string]interface{}{
|
||||
"uid": 1,
|
||||
"is_admin": true,
|
||||
"server_version": "19.0-go",
|
||||
"server_version_info": []interface{}{19, 0, 0, "final", 0, "g"},
|
||||
"db": s.config.DBName,
|
||||
}, nil)
|
||||
// Try context first, then fall back to cookie lookup
|
||||
sess := GetSession(r)
|
||||
if sess == nil {
|
||||
if cookie, err := r.Cookie("session_id"); err == nil && cookie.Value != "" {
|
||||
sess = s.sessions.Get(cookie.Value)
|
||||
}
|
||||
}
|
||||
if sess == nil {
|
||||
s.writeJSONRPC(w, nil, nil, &RPCError{
|
||||
Code: 100, Message: "Session expired",
|
||||
})
|
||||
return
|
||||
}
|
||||
s.writeJSONRPC(w, nil, s.buildSessionInfo(sess), nil)
|
||||
}
|
||||
|
||||
func (s *Server) handleDBList(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
Reference in New Issue
Block a user