Pre-alpha. No tagged release and no upgrade path between versions. Use for evaluation and development only, not production.
Addons DevPre-alpha

How to scaffold a new addon

Goal: create a valid module tree with manifest, Go model stub (sdk.Model tags), starter views, menus, and security files.

There are two entry points. Prefer the custom workspace unless you are contributing a module inside the kernel repo.

Prerequisites

  • Go toolchain per sumeru/go.mod
  • Sibling layout: sumeru/, sumeru_addons/, sumeru_custom_addons/

Custom workspace (usual path)

From sumeru_custom_addons/:

make new MODULE=my_module
make install MODULES=my_module
make run

make new runs sumeru-bp into addons/ then make generate. Generated files (do not hand-edit):

FileRole
models/zmodels.gosdk.MustRegister for each sdk.Model struct
models/zrefs.goTyped relation handles when you use cross-module Many2One types
init.goBlank-import of models/ only — rewritten on every generate
addonimports/zimports.goWorkspace blank-imports for discovered addons

Put event hooks and object actions in models/ (or another package imported from models/). Do not put lasting logic in custom-workspace init.go.

Use **^[a-z][a-z0-9_]*$ for the module name (e.g. sale_demo, not SaleDemo**).

Core repo (sumeru/addons)

When scaffolding inside the kernel checkout:

cd sumeru
make bp NAME=my_module
make generate
go run ./cmd/sumeru -- -c sumeru.conf -i my_module --stop-after-init

make bp is go run ./cmd/sumeru-bp -- -bp NAME. There is no scaffold subcommand and no WITH_MODELS flag. Models use sdk.Model tags; registration is always generated.

Custom output directory:

go run ./cmd/sumeru-bp -- -bp my_module -out addons

Default is already addons/ under the detected repo root.

What the scaffold emits

Copied from sumeru/cmd/sumeru-bp/templates/:

  • models/models.gosdk.Model + sdk.String / sdk.Text / sdk.Boolean / sdk.Integer tags
  • views/list_view.xml (not tree_view.xml)
  • views/form_view.xml, views/kanban_view.xml, views/actions.xml, views/menus.xml
  • security/sys.access.csv (not ir.model.access.csv)
  • Window action as sys.action.window

See also