Module Architecture - How Everything Fits Together
Module Architecture - How Everything Fits Together
Your Question: Where Does ai_sam_github_installer Belong?
You correctly identified that ai_sam_github_installer should be part of the initial installation. Here's the complete picture:
Repository Structure
D:\Odoo-18-SaaS\AI SAM and Our Odoo Github Repositories\
├── 01-odoo-18-lightweight-core\ ← This is bundled in the installer
│ ├── base\ (Full module - 16 total full modules)
│ ├── web\ (Full module)
│ ├── mail\ (Full module)
│ ├── ... (13 more full modules)
│ ├── ai_sam_github_installer\ ← FULL MODULE (this is the key!)
│ ├── account\ (Placeholder)
│ ├── sale\ (Placeholder)
│ ├── ... (640 more placeholders)
│ └── module_registry.json (Catalog of all 657 modules)
│
├── 02-odoo-18-standard-modules\ (On GitHub, downloaded on-demand)
├── 03-odoo-18-community-extras\ (On GitHub, downloaded on-demand)
├── 04-odoo-18-user-apps-manager\ (LEGACY - kept for reference)
│ └── ai_sam_github_installer\ (Original source - copied to 01)
├── 05-samai-brain\ (SAM AI modules - future)
├── 06-samai-core\
└── ... (other SAM AI repos)
The Key Insight
The ai_sam_github_installer module exists in two places for different purposes:
1. Source Location (04-odoo-18-user-apps-manager)
D:\Odoo-18-SaaS\AI SAM and Our Odoo Github Repositories\04-odoo-18-user-apps-manager\ai_sam_github_installer
- Purpose: Development and GitHub repository
- Contains: Full source code
- Used for: Development, updates, version control
- GitHub repo: https://github.com/SMEBusinessSupport/odoo-18-user-apps-manager
2. Bundled Location (01-odoo-18-lightweight-core)
D:\Odoo-18-SaaS\AI SAM and Our Odoo Github Repositories\01-odoo-18-lightweight-core\ai_sam_github_installer
- Purpose: Distribution with installer
- Contains: Copy of full module
- Used for: Bundled with installer so it's available immediately
- Included in: The lightweight-core that every installation gets
Why This Architecture?
Problem
Users need the ai_sam_github_installer module immediately on installation so they can download other modules. But we don't want to create a circular dependency where they need the installer to get the installer.
Solution
Bundle ai_sam_github_installer as one of the 16 full modules in lightweight-core.
Installation Flow
What Gets Installed
C:\Program Files\Odoo 18\
├── Python312\ (Bundled - 200MB)
├── PostgreSQL\15\ (Bundled if not existing)
├── server\ (Odoo core - bundled)
├── addons\
│ ├── lightweight-core\ ← FROM: 01-odoo-18-lightweight-core
│ │ ├── base\ (16 full modules)
│ │ ├── web\
│ │ ├── mail\
│ │ ├── ai_sam_github_installer\ ← FULL MODULE (ready to use!)
│ │ ├── account\ (641 placeholders)
│ │ ├── sale\
│ │ └── module_registry.json
│ └── user_addons\ (Empty - for downloaded modules)
└── config\
└── odoo.conf
What Happens On First Launch
- Odoo starts and scans
addons_path - Finds modules:
- 16 full modules (including
ai_sam_github_installer) - 641 placeholders
- User opens Apps menu:
- Sees all 657 modules in catalog
- Full modules show "Install" button
- Placeholder modules show "Install from GitHub" button
- User installs ai_sam_github_installer:
- Installs immediately (it's already on disk)
- Adds "App Store" menu item
- Now user can browse and install other modules
- User clicks "Install from GitHub" on any placeholder:
ai_sam_github_installerclones from GitHub- Copies to
user_addons/ - Registers with Odoo
- User can now install it normally
Installer Configuration
Inno Setup (odoo_samai_installer.iss)
[Files]
; Lightweight Core (16 full + 641 placeholders + GitHub installer)
Source: "D:\Odoo-18-SaaS\AI SAM and Our Odoo Github Repositories\01-odoo-18-lightweight-core\*";
DestDir: "{app}\addons\lightweight-core";
Components: lightweight_core;
Flags: ignoreversion recursesubdirs createallsubdirs
; Module Registry
Source: "D:\Odoo-18-SaaS\AI SAM and Our Odoo Github Repositories\01-odoo-18-lightweight-core\module_registry.json";
DestDir: "{app}\addons\lightweight-core"
Key points:
- Bundles entire 01-odoo-18-lightweight-core directory
- Includes ai_sam_github_installer as full module
- Includes module_registry.json with catalog
- Total size: ~50MB (vs 2GB+ for all modules)
Conversion Script (convert_to_lightweight.ps1)
$lightweightSource = "D:\Odoo-18-SaaS\AI SAM and Our Odoo Github Repositories\01-odoo-18-lightweight-core"
$lightweightDest = "$OdooPath\addons\lightweight-core"
# Copies entire lightweight-core (including ai_sam_github_installer)
Copy-Item -Path "$lightweightSource\*" -Destination $lightweightDest -Recurse -Force
The 16 Full Modules in Lightweight-Core
These are immediately available after installation:
- base - Core Odoo framework (required)
- web - Web interface (required)
- mail - Email integration
- contacts - Contact management
- product - Product catalog
- sale - Sales management (if you want it full, otherwise placeholder)
- purchase - Purchase management
- stock - Inventory management
- account - Accounting
- hr - Human resources
- project - Project management
- crm - Customer relationship management
- website - Website builder
- im_livechat - Live chat
- calendar - Calendar integration
- ai_sam_github_installer ← The GitHub module installer
Note: The exact list of 16 can be adjusted. The key is that ai_sam_github_installer must be one of them.
Module Registry Structure
The module_registry.json catalogs all 657 modules:
{
"modules": [
{
"name": "base",
"display_name": "Base",
"category": "Hidden",
"summary": "The kernel of Odoo",
"author": "Odoo S.A.",
"website": "https://www.odoo.com",
"is_full": true,
"is_placeholder": false,
"github_repo": null,
"file_path": "base"
},
{
"name": "ai_sam_github_installer",
"display_name": "GitHub Module Installer",
"category": "Tools",
"summary": "Install Odoo modules from GitHub repositories",
"author": "SME Business Support",
"website": "https://github.com/SMEBusinessSupport",
"is_full": true,
"is_placeholder": false,
"github_repo": "odoo-18-user-apps-manager",
"file_path": "ai_sam_github_installer"
},
{
"name": "account",
"display_name": "Accounting",
"category": "Accounting/Accounting",
"summary": "Accounting and Financial Management",
"author": "Odoo S.A.",
"website": "https://www.odoo.com/app/accounting",
"is_full": false,
"is_placeholder": true,
"github_repo": "odoo-18-standard-modules",
"file_path": "account"
}
]
}
How Installer Uses This
Step 1: User Runs Installer
- Smart detection wizard analyzes environment
- User makes choices about existing installations
Step 2: Files Extracted
Installer extracts to C:\Program Files\Odoo 18\:
├── Python312\ (from bundled\python-3.12\)
├── PostgreSQL\15\ (from bundled\postgresql-15\ if needed)
├── server\ (from bundled\odoo-18\)
└── addons\
└── lightweight-core\ (from 01-odoo-18-lightweight-core\)
├── base\ (full module)
├── ai_sam_github_installer\ (full module) ← KEY!
├── account\ (placeholder: __manifest__.py, icon, description)
└── ... (639 more placeholders)
Step 3: Configuration
[odoo.conf]
addons_path = C:\Program Files\Odoo 18\server\odoo\addons,
C:\Program Files\Odoo 18\addons\lightweight-core,
C:\Program Files\Odoo 18\addons\user_addons
Step 4: First Launch
- User starts Odoo
- Opens Apps menu
- Sees
ai_sam_github_installeras installable - Installs it (installs instantly - already on disk)
- Gets "App Store" menu
- Can now install other modules from GitHub
Impact on Your Scenarios
Scenario 1: Clean Machine (Laptop)
- Installer bundles
01-odoo-18-lightweight-core - Includes
ai_sam_github_installeras full module - User can immediately install it and use it
- No circular dependency
Scenario 2: Existing Odoo (Dev PC) - Conversion
# convert_to_lightweight.ps1 runs:
1. Queries database for installed modules
2. Removes unused module files
3. Copies from: D:\...\01-odoo-18-lightweight-core\
To: C:\Program Files\Odoo 18\addons\lightweight-core\
4. This includes ai_sam_github_installer as full module
Scenario 3: Side-by-Side Installation
- New installation at different port
- Gets full lightweight-core (including ai_sam_github_installer)
- Independent from existing Odoo
Maintenance Workflow
When You Update ai_sam_github_installer
-
Edit source:
D:\...\04-odoo-18-user-apps-manager\ai_sam_github_installer\ -
Push to GitHub:
bash cd "D:\...\04-odoo-18-user-apps-manager" git add . git commit -m "Update ai_sam_github_installer" git push -
Copy to lightweight-core:
powershell Copy-Item -Path "D:\...\04-odoo-18-user-apps-manager\ai_sam_github_installer" ` -Destination "D:\...\01-odoo-18-lightweight-core\ai_sam_github_installer" ` -Recurse -Force -
Commit lightweight-core:
bash cd "D:\...\01-odoo-18-lightweight-core" git add ai_sam_github_installer git commit -m "Update ai_sam_github_installer to latest version" git push -
Rebuild installer:
- Installer will now include updated version
- New installations get the latest
Summary
Your Question: "Where does ai_sam_github_installer belong?"
Answer: In BOTH places:
- Source repository (04): For development and GitHub distribution
- Lightweight-core (01): For bundling with installer
Why This Works
- No circular dependency: Installer includes full module
- Immediate availability: Users can install it right away
- Enable other installs: Once installed, users can get other modules from GitHub
- Maintainable: Update source, copy to lightweight-core, rebuild installer
- Clean separation: Development (04) vs Distribution (01)
What The Installer Does
Installer:
↓
Extracts: 01-odoo-18-lightweight-core (ALL of it)
↓
To: C:\Program Files\Odoo 18\addons\lightweight-core\
↓
Includes: 16 full modules (including ai_sam_github_installer)
+ 641 placeholders
+ module_registry.json
↓
User starts Odoo:
↓
Sees ai_sam_github_installer in Apps
↓
Installs it (instant - already on disk)
↓
Gets App Store menu
↓
Can install other modules from GitHub!
This architecture ensures the GitHub installer is always available from the moment Odoo is installed, enabling the entire hybrid system to work seamlessly.