Skip to content

Naming Conventions

Professional naming standards for repositories, modules, code, and infrastructure.

Overview

Consistent naming improves code readability, discoverability, and maintainability. This guide covers naming conventions used across the project.


Quick Reference

┌─────────────────────────────────────────────────┐
│           NAMING CONVENTIONS                     │
├─────────────────────────────────────────────────┤
│ Repositories:     kebab-case                     │
│ Odoo Modules:     snake_case with company_prefix │
│ Python Files:     snake_case.py                  │
│ Python Classes:   PascalCase                     │
│ Python Functions: snake_case                     │
│ Constants:        UPPER_SNAKE_CASE               │
│ Git Branches:     type/kebab-case-description    │
│ Git Tags:         v1.0.0 (semver)                │
│ Docker Images:    lowercase:version              │
│ Environments:     production, staging, dev       │
└─────────────────────────────────────────────────┘

Repository Naming

Format

product-component-environment

Patterns

Pattern Example Use Case
company-product google-chrome Public products
product-component react-router Libraries/tools
org-product-env acme-erp-production Internal systems
product-version odoo15-production Version-specific

Rules

Rule Good Bad
Use lowercase odoo15-production Odoo15-Production
Use hyphens my-project-name my_project_name
No spaces field-service field service
No special chars erp-system erp@system!
Be descriptive odoo15-erp-production proj1

Examples

# Good repository names
odoo15-erp-production
field-service-pwa
company-docs-portal

# Avoid
MyProject
project_name_here
proj-v2-final-FINAL

Odoo Module Naming

Format

companyprefix_feature_subfeature

Patterns

Pattern Example Description
company_feature jdx_service_signature Company custom module
feature_extension sale_order_photos Extending core module
integration_target xero_integration Third-party integration
app_feature helpdesk_department App-specific feature

Rules

Rule Good Bad
Use snake_case jdx_field_service jdx-field-service
Company prefix jdx_calendar calendar_custom
Descriptive name service_signature sig_mod
No version numbers jdx_sms jdx_sms_v2

Module Prefix Convention

jdx_*           → Your company's custom modules
justcall_*      → JustCall integration modules
xero_*          → Xero integration modules

Examples

# Good module names
jdx_service_signature
jdx_field_service_automation
jdx_fsm_calendar
justcall_sms
xero_integration

# Avoid
my_module
test_module_2
jdx_new_feature_final_v3

Python Naming

Files

# Good
models/sale_order.py
views/partner_views.xml
wizards/import_wizard.py

# Avoid
models/SaleOrder.py
views/partnerViews.xml
wizards/import-wizard.py

Classes

# Good - PascalCase
class SaleOrder(models.Model):
    pass

class JustCallSMSService:
    pass

# Avoid
class sale_order(models.Model):  # snake_case
    pass

class justcallSMSservice:  # mixed case
    pass

Functions and Methods

# Good - snake_case
def calculate_total_amount(self):
    pass

def send_sms_notification(self, phone, message):
    pass

# Avoid
def CalculateTotalAmount(self):  # PascalCase
    pass

def sendSMSNotification(self):  # camelCase
    pass

Variables

# Good - snake_case
order_total = 100.00
customer_name = "John Doe"
is_active = True

# Avoid
orderTotal = 100.00      # camelCase
CustomerName = "John"    # PascalCase
IsActive = True          # PascalCase

Constants

# Good - UPPER_SNAKE_CASE
MAX_RETRY_ATTEMPTS = 3
DEFAULT_TIMEOUT = 30
API_BASE_URL = "https://api.example.com"

# Avoid
maxRetryAttempts = 3     # camelCase
default_timeout = 30     # looks like variable

Odoo Model Names

# Good - dot notation, lowercase
_name = 'sale.order'
_name = 'jdx.service.signature'
_name = 'helpdesk.ticket'

# Avoid
_name = 'SaleOrder'           # PascalCase
_name = 'jdx_service_sig'     # underscore

Git Naming

Branches

Format

type/short-description

Types

Type Description Example
feature/ New feature feature/add-mms-support
bugfix/ Bug fix bugfix/fix-sms-timeout
hotfix/ Emergency fix hotfix/critical-auth-bug
release/ Release preparation release/v1.2.0
docs/ Documentation docs/update-api-guide
refactor/ Code refactoring refactor/simplify-auth
test/ Testing changes test/add-unit-tests

Rules

# Good branch names
feature/add-customer-phone-field
bugfix/fix-signature-upload
hotfix/security-patch
docs/update-installation-guide

# Avoid
new-feature              # no type prefix
feature/Add_New_Feature  # mixed case, underscores
myBranch                 # not descriptive
feature/john-working     # developer name

Tags

Format

v{MAJOR}.{MINOR}.{PATCH}

Examples

# Release tags
v1.0.0      # Initial release
v1.1.0      # New features
v1.1.1      # Bug fixes
v2.0.0      # Breaking changes

# Pre-release tags
v1.2.0-alpha.1
v1.2.0-beta.1
v1.2.0-rc.1

Commit Messages

Format

type(scope): description

Types

Type Description
feat New feature
fix Bug fix
docs Documentation
style Formatting
refactor Code restructuring
test Adding tests
chore Maintenance

Examples

# Good commit messages
feat(justcall): Add MMS support for outgoing messages
fix(signature): Fix S3 upload timeout for large files
docs(api): Update authentication examples
refactor(pwa): Simplify job list rendering
chore(deps): Update Python dependencies

# Avoid
fixed stuff                    # not descriptive
WIP                           # not meaningful
asdfasdf                      # random
Feature: Add new feature      # wrong format

Docker Naming

Images

Format

organization/product:version

Examples

# Good
company/odoo:15.0
company/pwa:1.2.0
company/docs:latest

# Avoid
myodoo                    # no organization
Company/Odoo:V1          # uppercase
odoo-image-final-v2      # not versioned properly

Containers

Format

project-service-instance

Examples

# Good (auto-generated by compose)
odoo15-production-odoo-1
odoo15-production-pwa-1
odoo15-production-db-1

# Service names in docker-compose.yml
services:
  odoo:      # lowercase, simple
  pwa:
  db:
  nginx:
  docs:

Networks

# Good
networks:
  odoo-network:
  backend:
  frontend:

# Avoid
networks:
  myNetwork:     # camelCase
  network_1:     # numbered

Volumes

# Good
volumes:
  odoo-data:
  postgres-data:
  filestore:

# Avoid
volumes:
  data:          # too generic
  Volume1:       # uppercase, numbered

Environment Naming

Standard Environments

Name Purpose Example URL
production Live system erp.company.com
staging Pre-production testing staging.company.com
development Developer testing dev.company.com
local Local machine localhost

Environment Variables

# Good - UPPER_SNAKE_CASE with prefix
ODOO_DATABASE=odoo_production
POSTGRES_PASSWORD=secret
AWS_ACCESS_KEY_ID=xxx
JUSTCALL_API_KEY=xxx

# Avoid
database=odoo            # lowercase
postgresPassword=xxx     # camelCase
key=xxx                  # not descriptive

Database Naming

Databases

# Good
odoo_production
odoo_staging
odoo_development

# Avoid
odoo                     # no environment
production_db            # inconsistent
myDatabase              # camelCase

Tables (Odoo auto-generates)

-- Odoo convention: model name with dots → underscores
sale_order              -- from sale.order
helpdesk_ticket         -- from helpdesk.ticket
jdx_service_signature   -- from jdx.service.signature

File and Directory Naming

Directories

# Good - lowercase, hyphens or underscores
extra-addons/
docs/content/
scripts/
nginx/conf.d/

# Avoid
Extra-Addons/           # uppercase
myScripts/              # camelCase

Configuration Files

# Good
docker-compose.yml
docker-compose.test.yml
odoo.conf
nginx.conf
.env
.env.example

# Avoid
Docker-Compose.yml      # uppercase
config.yaml.bak         # backup in repo

Documentation

# Good
README.md
CHANGELOG.md
CONTRIBUTING.md
docs/content/getting-started/installation.md

# Avoid
readme.txt              # wrong extension
CHANGELOG              # no extension
Docs/Installation.MD   # inconsistent case

Multi-Project Naming

By Environment

mycompany-erp-production
mycompany-erp-staging
mycompany-erp-development

By Client

clienta-odoo15-production
clientb-odoo15-production
clientc-odoo15-production

By Product Line

erp-core
erp-manufacturing
erp-retail
erp-field-service

Industry Standards Reference

Odoo Community (OCA)

OCA/account-financial-tools
OCA/sale-workflow
OCA/stock-logistics-warehouse

Pattern: {org}/{category}-{subcategory}

Tech Giants

Company Pattern Example
Google google/product google/guava
Microsoft microsoft/product microsoft/vscode
Facebook facebook/product facebook/react
Odoo odoo/product odoo/odoo

Checklist

Before creating something new, verify:

  • Repository: kebab-case, lowercase
  • Module: snake_case with company prefix
  • Branch: type/kebab-description
  • Tag: vX.Y.Z format
  • Classes: PascalCase
  • Functions: snake_case
  • Constants: UPPER_SNAKE_CASE
  • Files: snake_case.py or kebab-case.md
  • Docker: lowercase:version
  • Environment vars: UPPER_SNAKE_CASE