Module structure
The backend is a single consolidated Odoo 12 addon:API gateway
All endpoints live under/pos-api/v1/* in controllers/api_v1.py. The gateway handles:
- JWT Bearer token validation
- CORS headers
- Request routing to legacy controller methods
The legacy controller methods in
api.py, api_orders.py, etc. have no routes of their own — they are called by api_v1.py.Extending bootstrap data
To add data to the bootstrap payload, extend thepos.config model:
Upgrading modules
Migrations
Version-specific migration scripts go inmigrations/<version>/pre-migrate.py or post-migrate.py. The <version> must match the new version in __manifest__.py.
Declarative configuration
Backend POS configuration (printers, print routes, discount presets, void reasons, special-request tags, side-dish groups, picking-sale reasons, shared configs, and per-terminalnu_* fields) is managed declaratively via the JSON config sync loader. The most recently applied document is replayed automatically on module install and upgrade.
Permissions
The permission system has three layers resolved in order:- Factory defaults —
permission_registry.pyPERMISSION_DEFAULTS - Per-config role overrides —
nu.pos.permission.configmodel - Per-user grant/deny —
nu.pos.permission.user.overridemodel
Adding a new permission
- Add the key and default to
PERMISSION_DEFAULTSinpermission_registry.py - Mirror the same key and default in
permissions.tson the frontend - Both files must stay in sync