This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
IMPORTANT: This project uses Odoo 18.0. Always follow Odoo 18.0 conventions:
- Use
<list>instead of<tree>for list views in XML - Use
_compute_display_nameinstead ofname_get()method - Use
<chatter />tag instead of verbose chatter XML - Use
/** @odoo-module **/for JavaScript modules - Follow OWL v2 patterns for reactive components
- All view modes:
list,form,kanban(nottree,form,kanban)
This is an Odoo 18.0 module suite for aviation/flight management called SmartOps Flight. It provides comprehensive functionality for managing flights, aircraft, aerodromes, crew, and related aviation operations.
Migration Status: ✅ Successfully migrated from Odoo 16.0 to 18.0. See MIGRATION_16_TO_18.md for complete migration details.
The codebase consists of multiple interdependent Odoo modules:
- flight: Core module with base models for flights, aircraft, aerodromes, and crew
- flight_aircraft_spec: Aircraft specifications and amenities management
- flight_data_sync: Data synchronization with external providers
- flight_event: Flight events and phases tracking (takeoff, landing, etc.)
- flight_number: Flight number management and prefix configuration
- flight_portal: Portal access for external users
- flight_uom: Aviation-specific units of measurement
- website_flight_fleet: Public website features for fleet display
Modules inherit from flight base module and follow Odoo's dependency chain. The flight_uom module provides units of measurement used across other modules.
# Run pre-commit hooks (includes ruff, prettier, eslint, and Odoo-specific checks)
pre-commit run --all-files
# Run ruff for Python linting and formatting
ruff format . # Format Python code
ruff check . --fix # Fix linting issues (safe fixes only)
ruff check . --fix --unsafe-fixes # Fix all issues including unused variables
# Combined ruff command for complete cleanup
ruff format . && ruff check . --fix --unsafe-fixes
# Run eslint for JavaScript
npx eslint . --fix
# Run prettier for XML, HTML, CSS, and JS formatting
npx prettier --write "**/*.{xml,html,css,js,json,yml}"# Start Odoo with this module path
# Note: Assumes Odoo is installed and configured
odoo -c odoo.conf --addons-path=/Users/alexis/Work/kzr/kzr-odoo/extra-addons/.src/smartops/flight,/path/to/odoo/addons
# Update module list and install/upgrade modules
odoo -c odoo.conf -u flight -i flight_event,flight_aircraft_spec
# Run Odoo in development mode with auto-reload
odoo -c odoo.conf --dev=reload# Run all tests using the test runner
./run_tests.sh
# Run tests for a specific module with tags
python src/odoo/odoo-bin --test-enable --stop-after-init --test-tags=flight \
--db_host=localhost --db_user=odoo --db_password=odoo \
--addons-path=src/odoo/addons/,extra-addons/ -d odoo_test_flight -u flightSee TESTING.md for comprehensive testing documentation.
All flight-related models inherit from:
mail.thread- for chatter and activity trackingmail.activity.mixin- for scheduled activitiesflight.lock.mixin- custom mixin for record locking functionality
Display Name (ALWAYS use this pattern):
@api.depends('field1', 'field2') # Include all fields used
def _compute_display_name(self):
for record in self:
record.display_name = f"{record.field1} - {record.field2}"Chatter in Views:
<!-- Simple tag replaces verbose structure -->
<chatter />Slug Generation for URLs:
IrHttp = self.env['ir.http']
url = f"/path/{IrHttp._slug(record)}"- Uses Odoo's standard access control with
ir.model.access.csvfiles - Security groups defined in
security/security.xml - Portal users have limited read access via
flight_portalmodule
- Custom Odoo 18 widgets in
static/src/components/ - Uses OWL framework v2 for reactive components
- JavaScript modules use ES module format with
/** @odoo-module **/ - JavaScript assets registered in
__manifest__.pyunderassetskey
- CSV data files for initial setup in
data/directories - XML demo data in
demo/directories - Large aerodrome dataset loaded separately due to size
- Version-specific migrations in
migrations/folders - Follow pattern:
migrations/{version}/post-migrate.pyorpre-migrate.py
The full aerodrome dataset is not included by default. To load:
- Download from: https://raw.githubusercontent.com/smartops-aero/smartops-odoo-flight/18.0/flight/data/flight.aerodrome.csv
- Import via Flights -> Configuration -> Aerodromes -> Import
Uses whool build backend (specified in pyproject.toml) for Python package management.
- Python 3.10+ (recommended 3.11+)
- See requirements.txt for any external dependencies
- Python: Ruff with custom configuration (target Python 3.11+)
- JavaScript: ESLint with Odoo-specific globals, ES modules with
/** @odoo-module **/ - XML/HTML: Prettier with XML plugin
- Pre-commit hooks enforce all style rules
- Main branch:
18.0(Odoo version) - Previous version:
16.0branch - All PRs should target the
18.0branch
- Module not found: Ensure the addons path includes this directory
- Access rights errors: Check
ir.model.access.csvfor missing entries - JavaScript errors: Verify asset bundle registration in
__manifest__.py - Migration issues: Check version numbers in
__manifest__.pymatch migration folders