/odoo-agent-pro-kit:odoo_restart_upgrade_rulesfrom Odoo Agent Pro Kit
Provides rules for when to restart vs. upgrade Odoo modules based on code changes. Covers field definitions, views, security, and data files.
Ships in Odoo Agent Pro Kit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Odoo requires different restart/upgrade strategies depending on what changed in your custom code. This skill defines the rules.
Use restart when changes are confined to:
@api.depends(...))def action_*)fields or use @api.onchange with new fieldsExample:
@api.depends('amount', 'tax_rate')
def _compute_total(self):
self.total = self.amount * (1 + self.tax_rate / 100) # ✅ RESTART ONLY
@api.constrains(...) - constraint logic@api.onchange(...) - on existing fields only@api.depends(...) - on existing fields onlyExample:
@api.constrains('price')
def _check_price(self):
if self.price < 0:
raise ValidationError("Price must be positive") # ✅ RESTART ONLY
Example:
@http.route('/my_module/api/data', auth='user', type='json')
def get_data(self):
return {'data': self.env['my.model'].search_read([])} # ✅ RESTART ONLY
import statementsRestart Command:
# Kill and restart Odoo server on port
pkill -f "odoo-bin.*19.0"
# or use manage_modules.sh
./manage_modules.sh restart
Use upgrade when changes include:
fields.Char(), fields.Many2one(), etc.)Char → Integer)string=, required=True, readonly=True, etc.)compute=, search=, inverse=)Example - REQUIRES UPGRADE:
# Old version
class CoffeeOrder(models.Model):
amount = fields.Float()
# New version - ⚠️ REQUIRES UPGRADE
class CoffeeOrder(models.Model):
amount = fields.Float()
total_with_tax = fields.Float(compute='_compute_total') # ⚠️ NEW FIELD → UPGRADE
tax_rate = fields.Float(default=0.15) # ⚠️ NEW FIELD → UPGRADE
<form>, <list>, <kanban> viewsinvisible="...")Example - REQUIRES UPGRADE:
<!-- Old view -->
<form>
<field name="name"/>
</form>
<!-- New view - ⚠️ REQUIRES UPGRADE -->
<form>
<field name="name"/>
<field name="category_id"/> <!-- ⚠️ NEW FIELD IN VIEW → UPGRADE -->
<field name="total" invisible="state != 'done'"/> <!-- ⚠️ NEW LOGIC → UPGRADE -->
</form>
_name, _description, _order_inherit)_sql_constraintsExample - REQUIRES UPGRADE:
# New model added - ⚠️ REQUIRES UPGRADE
class CoffeeRoastingBatch(models.Model):
_name = 'coffee.roasting.batch'
_description = 'Coffee Roasting Batch'
name = fields.Char()
roast_level = fields.Selection([
('light', 'Light'),
('dark', 'Dark'),
])
data/*.xmlsecurity/ir.model.access.csv (17–19) or security/ir.access.csv (20)Example - REQUIRES UPGRADE:
security/ir.model.access.csv
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_coffee_user,Coffee User,model_coffee_manufacturing,group_coffee_user,1,0,0,0
# ⚠️ NEW RECORD → REQUIRES UPGRADE
Example - REQUIRES UPGRADE:
<!-- reports/coffee_label_report.xml - ⚠️ NEW REPORT → UPGRADE -->
<template id="report_coffee_label">
<div class="page">
<h2><span t-field="record.name"/></h2>
<p><strong>Roast Level:</strong> <span t-field="record.roast_level"/></p>
</div>
</template>
Upgrade Command:
./manage_modules.sh update module_name
┌─────────────────────────────────┐
│ What Changed? │
└─────────────────────────────────┘
│
├─ New/Modified FIELD? ────────→ 🔴 UPGRADE MODULE
│
├─ View Changes (<form>, <list>, etc.)? ──→ 🔴 UPGRADE MODULE
│
├─ New Model Created? ────────→ 🔴 UPGRADE MODULE
│
├─ Data/CSV/XML Changes? ────────→ 🔴 UPGRADE MODULE
│
├─ Python Method/Logic Only? ────→ 🟢 RESTART SERVER
│ (no fields, no views, no models)
│
└─ Controller/Route Changes? ────→ 🟢 RESTART SERVER
{
"features": [{
"task": "Initial Setup",
"sub_tasks": [
{ "name": "Create models with fields", "status": "pending" },
{ "name": "Create views", "status": "pending" },
{ "name": "LIVE TEST: Install module (manage_modules.sh install)", "status": "pending" }
]
}]
}
Action: ./manage_modules.sh install module_name
{
"features": [
{ "task": "Feature 1", "status": "complete" },
{
"task": "Improve Order Logic",
"sub_tasks": [
{ "name": "Update compute method", "status": "pending" },
{ "name": "LIVE TEST: Restart server (manage_modules.sh restart)", "status": "pending" }
]
}
]
}
Action: ./manage_modules.sh restart
{
"features": [
{ "task": "Feature 1", "status": "complete" },
{
"task": "Add Flavor Support",
"sub_tasks": [
{ "name": "Add flavor_id field to product", "status": "pending" },
{ "name": "Update product view with flavor field", "status": "pending" },
{ "name": "LIVE TEST: Upgrade module (manage_modules.sh update)", "status": "pending" }
]
}
]
}
Action: ./manage_modules.sh update module_name
Use when testing model data operations:
# test_coffee_order_xmlrpc.py
import xmlrpc.client
url = 'http://localhost:8090'
db = 'odoo19'
username = 'admin'
password = 'admin'
common = xmlrpc.client.ServerProxy(f'{url}/xmlrpc/2/common')
uid = common.authenticate(db, username, password, {})
models = xmlrpc.client.ServerProxy(f'{url}/xmlrpc/2/object')
# Create order
order_id = models.execute_kw(db, uid, password, 'coffee.order', 'create', [{
'name': 'Test Order',
'amount': 100.0,
}])
# Read
order = models.execute_kw(db, uid, password, 'coffee.order', 'read', [order_id], {'fields': ['name', 'amount']})
print(order)
Use when testing controllers/endpoints:
# test_coffee_api_jsonrpc.py
import requests
import json
session = requests.Session()
session.auth = ('admin', 'admin')
# Call JSON-RPC endpoint
data = {
'jsonrpc': '2.0',
'method': 'call',
'params': {
'service': 'object',
'method': 'execute_kw',
'args': ['odoo19', 2, 'admin', 'coffee.order', 'create', [{
'name': 'API Test Order',
'amount': 150.0,
}]]
}
}
response = session.post('http://localhost:8090/jsonrpc', json=data)
result = response.json()
print(result)
After each sub-task, agent should:
execute_bashExample test sub-task addition:
{
"name": "Create test script and verify",
"test_type": "xmlrpc",
"test_file": "tests/test_coffee_order.py",
"status": "pending"
}
ODOO_RESTART_UPGRADE_RULES = """
When implementing Odoo features:
1. **Field Changes** → Always use `upgrade` (manage_modules.sh update)
2. **View Changes** → Always use `upgrade` (manage_modules.sh update)
3. **Python Logic Only** → Use `restart` (manage_modules.sh restart)
4. **First Feature** → Use `install` (manage_modules.sh install)
5. **Generate test scripts** (XMLRPC/JSONRPC) per sub-task
Consult Odoo Restart vs. Upgrade Rules skill for details.
"""
def select_test_command(changes: Dict[str, bool]) -> str:
"""Select restart vs upgrade based on changes."""
if changes['has_field_changes'] or changes['has_view_changes'] or changes['has_model_changes']:
return 'upgrade' # manage_modules.sh update
elif changes['has_python_logic']:
return 'restart' # manage_modules.sh restart
return 'install' # First time only
Feature 1: Product Setup
Tasks:
- Define coffee.roasting.batch model (field: roast_level)
- Create form/list views
- LIVE TEST: install (manager_modules.sh install)
→ Action: INSTALL (first time)
Feature 2: Add Flavor Support
Tasks:
- Add flavor_id field to product
- Update product view
- LIVE TEST: upgrade (manage_modules.sh update)
→ Action: UPGRADE (field + view changes)
Feature 3: Improve Roasting Logic
Tasks:
- Add compute method for _compute_roast_time
- LIVE TEST: restart (manage_modules.sh restart)
→ Action: RESTART (Python logic only)
Feature 1: Shop Setup
→ Action: INSTALL
Feature 2: Add Cart Discount
→ Action: UPGRADE (new field discount_rate on sale.order.line)
Feature 3: Fix Price Calculation
→ Action: RESTART (fix _compute_total method)
| Change Type | Action | Time | Reason |
|---|---|---|---|
| New Field | UPGRADE | 10-30s | Database schema + ORM cache |
| View Change | UPGRADE | 10-30s | XML parsing + view registry |
| Python Logic | RESTART | 2-5s | Code reload only |
| New Model | UPGRADE | 10-30s | Full registry rebuild |
| Data Files | UPGRADE | 10-30s | Data loading + constraints |
| Controllers | RESTART | 2-5s | Route handler reload |
install vs update vs restart was usedWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub vperfectcs/odoo-agent-pro-kit --plugin odoo-agent-pro-kit31 skills in this plugin
/agent_browser_automationBrowser automation for Odoo web testing, form filling, screenshots, documentation, and frontend validation. Use when testing Odoo web pages, creating module screenshots, validating forms, or automating browser interactions for Odoo 17/18/19./odoo_commanding_systemSlash command router providing three lifecycle commands for Odoo custom app development: /plan-analysis (requirements & PRD generation), /start-coding (task-loop with backend testing), /testing (frontend UI testing & documentation). Version-aware (17|18|19), IDE/CLI agnostic. Works from VS Code, Antigravity, Cursor, or terminal./docker-sandbox-multi-cli-adapterManage multiple coding-agent CLIs (Codex, Claude, Hermes, Gemini) in Docker Sandbox phases for Odoo development./docker-sandbox-operationsConfigure, migrate, operate, validate, benchmark, upgrade, roll back, and release the Odoo 17/18/19 Docker Sandbox runtime. Use for Docker Sandbox onboarding, platform setup, local-to-sandbox migration, session lifecycle, release acceptance, capacity measurement, or troubleshooting in this repository./excalidraw-diagramCreate Excalidraw diagram JSON files that make visual arguments. Use when the user wants to visualize workflows, architectures, or concepts./odoo_17_coding_standardOdoo 17.0 coding standards for models, views, security, constraints, and performance. Use when developing Odoo 17 modules to ensure maintainable, upgrade-safe code.Other plugins' skills for the same job