1.8 KiB
1.8 KiB
Add integration for a new Odoo Studio model to an existing PWA project.
What this command does:
- Invokes the
add-odoo-modelskill - 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:
- Current working directory - Must be inside an existing Odoo PWA project
- Framework - Detect from project files (SvelteKit/React/Vue)
- New model name (without
x_prefix, e.g., "task", "product") - Model display name (human-readable, e.g., "Task", "Product")
- Generate UI? - Whether to create form and list pages (yes/no)
Steps:
- Verify the current directory is an Odoo PWA project (check for odoo.js, cache stores)
- Detect the framework from project structure
- Ask the user for the new model details
- Create cache store for the model in
src/lib/stores/or equivalent - Update the Odoo API client with methods for the new model
- If requested, generate form and list pages/components
- Update navigation/routing if UI was generated
- 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.jsor equivalent - Project has existing cache stores
.envfile exists with Odoo configuration- Framework can be detected
After adding model:
Remind the user to:
- Update
.envwith any new model-specific configuration - Test the new model's CRUD operations
- Verify sync functionality works correctly
- Update any necessary business logic or calculations