Files
gh-jamshu-jamshi-marketplac…/commands/add-model.md
2025-11-29 18:50:06 +08:00

1.8 KiB

Add integration for a new Odoo Studio model to an existing PWA project.

What this command does:

  • Invokes the add-odoo-model skill
  • Creates cache store for the new model
  • Adds API methods to the Odoo client
  • Generates form and list pages (optional)
  • Updates navigation and routing
  • Maintains consistency with existing project structure

Required Information:

Before starting, gather:

  1. Current working directory - Must be inside an existing Odoo PWA project
  2. Framework - Detect from project files (SvelteKit/React/Vue)
  3. New model name (without x_ prefix, e.g., "task", "product")
  4. Model display name (human-readable, e.g., "Task", "Product")
  5. Generate UI? - Whether to create form and list pages (yes/no)

Steps:

  1. Verify the current directory is an Odoo PWA project (check for odoo.js, cache stores)
  2. Detect the framework from project structure
  3. Ask the user for the new model details
  4. Create cache store for the model in src/lib/stores/ or equivalent
  5. Update the Odoo API client with methods for the new model
  6. If requested, generate form and list pages/components
  7. Update navigation/routing if UI was generated
  8. Update documentation with the new model

Example prompts to use this command:

  • /add-model - Interactive mode, will ask for all parameters
  • User: "Add a task model to my PWA"
  • User: "Integrate product catalog from Odoo"

Validation:

Before proceeding, check:

  • Project has src/lib/odoo.js or equivalent
  • Project has existing cache stores
  • .env file exists with Odoo configuration
  • Framework can be detected

After adding model:

Remind the user to:

  1. Update .env with any new model-specific configuration
  2. Test the new model's CRUD operations
  3. Verify sync functionality works correctly
  4. Update any necessary business logic or calculations