Skip to Content

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

  1. Odoo starts and scans addons_path
  2. Finds modules:
  3. 16 full modules (including ai_sam_github_installer)
  4. 641 placeholders
  5. User opens Apps menu:
  6. Sees all 657 modules in catalog
  7. Full modules show "Install" button
  8. Placeholder modules show "Install from GitHub" button
  9. User installs ai_sam_github_installer:
  10. Installs immediately (it's already on disk)
  11. Adds "App Store" menu item
  12. Now user can browse and install other modules
  13. User clicks "Install from GitHub" on any placeholder:
  14. ai_sam_github_installer clones from GitHub
  15. Copies to user_addons/
  16. Registers with Odoo
  17. 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:

  1. base - Core Odoo framework (required)
  2. web - Web interface (required)
  3. mail - Email integration
  4. contacts - Contact management
  5. product - Product catalog
  6. sale - Sales management (if you want it full, otherwise placeholder)
  7. purchase - Purchase management
  8. stock - Inventory management
  9. account - Accounting
  10. hr - Human resources
  11. project - Project management
  12. crm - Customer relationship management
  13. website - Website builder
  14. im_livechat - Live chat
  15. calendar - Calendar integration
  16. 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

  1. User starts Odoo
  2. Opens Apps menu
  3. Sees ai_sam_github_installer as installable
  4. Installs it (installs instantly - already on disk)
  5. Gets "App Store" menu
  6. 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_installer as 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

  1. Edit source:
    D:\...\04-odoo-18-user-apps-manager\ai_sam_github_installer\

  2. Push to GitHub:
    bash cd "D:\...\04-odoo-18-user-apps-manager" git add . git commit -m "Update ai_sam_github_installer" git push

  3. 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

  4. 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

  5. Rebuild installer:

  6. Installer will now include updated version
  7. New installations get the latest

Summary

Your Question: "Where does ai_sam_github_installer belong?"

Answer: In BOTH places:

  1. Source repository (04): For development and GitHub distribution
  2. 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.

Was this helpful?