Fix null→false, stock seed data, action_get on model, FK order

- Normalize null DB values to false (Odoo convention) in web_search_read
  and web_read responses
- Seed stock reference data: 6 locations, 1 warehouse, 3 picking types
- Fix FK order: warehouse must be created before picking types
- Move action_get from hardcoded dispatcher to res.users RegisterMethod
- Add action_res_users_my (ID 103) to seedActions
- Remove hardcoded action_get case from dispatchORM

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Marc
2026-04-01 02:52:15 +02:00
parent 3e6b1439e4
commit 06e49c878a
5 changed files with 103 additions and 19 deletions

View File

@@ -61,6 +61,23 @@ func initResUsers() {
Help: "External user with limited access (portal/public)",
}),
)
// -- Methods --
// action_get returns the "Change My Preferences" action for the current user.
// Mirrors: odoo/addons/base/models/res_users.py Users.action_get()
m.RegisterMethod("action_get", func(rs *orm.Recordset, args ...interface{}) (interface{}, error) {
return map[string]interface{}{
"type": "ir.actions.act_window",
"name": "Change My Preferences",
"res_model": "res.users",
"view_mode": "form",
"views": [][]interface{}{{false, "form"}},
"target": "new",
"res_id": rs.Env().UID(),
"context": map[string]interface{}{},
}, nil
})
}
// initResGroups registers the res.groups model.