Custom modules#

For: developers

This section walks you through creating a custom Odoo module for OpenSPP. OpenSPP modules follow standard Odoo module conventions with additional naming rules, security patterns, and mixins specific to the platform.

Before you start#

Make sure you have:

Quick start checklist#

Creating a new OpenSPP module involves these steps:

  1. Scaffold — Create the directory structure, manifest, and init files

  2. Models — Define your models using the spp.* namespace with correct field naming

  3. Security — Set up the three-tier group hierarchy, ACLs, and record rules

  4. Views — Create form, list, and search views with the correct XML ID naming

  5. Mixins — Integrate OpenSPP mixins for approval workflows, source tracking, etc.

  6. Tests — Write tests using TransactionCase with role-based access testing

Topics covered#

  • Module scaffold: Directory structure, manifest, and initial files

  • Models: The spp.* namespace, field naming rules, and model patterns

  • Security: Three-tier group architecture, ACLs, and record rules

  • Views and menus: XML ID conventions, view patterns, and menu structure

  • Mixins: Available OpenSPP mixins and when to use them

  • Testing: Test patterns, helpers, and role-based testing

  • Example: custom registry fields: Complete walkthrough building a module that adds fields to the individual registry