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:
Marc
2026-03-31 23:16:26 +02:00
parent 8741282322
commit 9c444061fd
32 changed files with 3416 additions and 148 deletions

View File

@@ -12,21 +12,24 @@ func fieldsGetForModel(modelName string) map[string]interface{} {
result := make(map[string]interface{})
for name, f := range m.Fields() {
fType := f.Type.String()
fieldInfo := map[string]interface{}{
"name": name,
"type": f.Type.String(),
"string": f.String,
"help": f.Help,
"readonly": f.Readonly,
"required": f.Required,
"searchable": f.IsStored(),
"sortable": f.IsStored(),
"store": f.IsStored(),
"manual": false,
"depends": f.Depends,
"groupable": f.IsStored() && f.Type != orm.TypeText && f.Type != orm.TypeHTML,
"exportable": true,
"name": name,
"type": fType,
"string": f.String,
"help": f.Help,
"readonly": f.Readonly,
"required": f.Required,
"searchable": f.IsStored(),
"sortable": f.IsStored(),
"store": f.IsStored(),
"manual": false,
"depends": f.Depends,
"groupable": f.IsStored() && f.Type != orm.TypeText && f.Type != orm.TypeHTML,
"exportable": true,
"change_default": false,
"company_dependent": false,
}
// Relational fields
@@ -46,7 +49,24 @@ func fieldsGetForModel(modelName string) map[string]interface{} {
fieldInfo["selection"] = sel
}
// Domain & context defaults
// Monetary fields need currency_field
if f.Type == orm.TypeMonetary {
cf := f.CurrencyField
if cf == "" {
cf = "currency_id"
}
fieldInfo["currency_field"] = cf
}
// Computed fields
if f.Compute != "" {
fieldInfo["compute"] = f.Compute
}
if f.Related != "" {
fieldInfo["related"] = f.Related
}
// Default domain & context
fieldInfo["domain"] = "[]"
fieldInfo["context"] = "{}"