Skip to content

Odoo Server Actions & Automated Actions: No-Code Automation Guide

DeployMonkey Team · March 22, 2026 14 min read

What Are Server Actions?

Server actions execute logic without writing Python code. They run from buttons, scheduled actions, or automated action triggers. Perfect for: sending emails, updating fields, creating records, and executing Python snippets.

Server Action Types

TypeUse CaseExample
Update RecordChange field valuesSet stage to 'Won' when amount > $10K
Create RecordGenerate new recordsCreate task when lead is qualified
Send EmailSend template emailSend welcome email on partner creation
Add FollowersSubscribe usersAdd sales manager to high-value deals
Create Next ActivitySchedule follow-upSchedule call 3 days after quote sent
Execute CodeRun PythonComplex logic, API calls, calculations
Send SMSSMS notificationAppointment reminder via SMS

Creating a Server Action

Via Settings (No-Code)

  1. Settings → Technical → Server Actions
  2. Click Create
  3. Select Model (e.g., Sale Order)
  4. Choose Action Type
  5. Configure parameters
  6. Save

Example: Update Record

# When: Sale order amount > 10,000
# Action: Set priority to 'High' and add tag 'VIP'

# Model: Sale Order (sale.order)
# Action Type: Update Record
# Fields to update:
#   priority = '2' (High)
#   tag_ids = [(4, ref('sale.tag_vip'))]

Example: Create Record

# When: CRM lead reaches 'Qualified' stage
# Action: Create a project task for implementation planning

# Model: CRM Lead (crm.lead)
# Action Type: Create Record
# Target Model: Project Task (project.task)
# Values:
#   name = "Implementation: " + record.name
#   project_id = ref('project.implementation_project')
#   partner_id = record.partner_id.id
#   description = record.description

Example: Execute Code

# Available variables in code actions:
# record / records — the record(s) triggering the action
# env — the Odoo environment
# model — the model being acted on
# datetime, dateutil — date utilities
# time — time module
# log — logging function
# Warning — raise warning

# Example: Calculate commission and create record
for rec in records:
    if rec.amount_total > 5000:
        commission = rec.amount_total * 0.05
        env['hr.expense'].create({
            'name': f'Commission: {rec.name}',
            'employee_id': rec.user_id.employee_id.id,
            'total_amount': commission,
            'product_id': env.ref('hr_expense.product_commission').id,
        })
        log(f"Created commission {commission} for {rec.name}")

Automated Actions (Triggers)

Automated actions combine a trigger with a server action. The trigger fires automatically when conditions are met.

Trigger Types

TriggerWhen It FiresExample
On CreationRecord is createdSend welcome email when customer created
On UpdateSpecific field changesNotify manager when deal stage changes
On Creation & UpdateBothValidate data on every save
On DeletionRecord is deletedLog deletion to audit trail
Based on Timed ConditionTime-basedSend reminder 3 days before due date
Based on Form ModificationForm changed (not saved)Show warning before user saves

Creating an Automated Action

  1. Settings → Technical → Automated Actions
  2. Select Model
  3. Choose Trigger
  4. Set Filter (when to trigger)
  5. Set Before Update Filter (for update triggers)
  6. Choose Action(s) to execute

Example: Auto-Assign Sales Team

# Trigger: On Creation of CRM Lead
# Filter: Country is United States
# Action: Update Record
#   team_id = ref('sales_team.salesteam_us')
#   user_id = ref('base.user_us_manager')

# Filter Domain: [('country_id.code', '=', 'US')]

Example: Timed Reminder

# Trigger: Based on Timed Condition
# Model: Sale Order
# Date Field: validity_date (Expiration Date)
# Trigger: 3 days before
# Filter: state = 'draft' (only for quotations)
# Action: Send Email
# Template: "Your quotation expires in 3 days"

Common Patterns

  • Auto-assignment: Route leads to teams based on country, source, or product interest
  • Escalation: If ticket not resolved in 24h, reassign to senior agent
  • Notification: Email manager when invoice amount exceeds threshold
  • Data validation: Prevent saving if required fields are empty
  • Cross-module creation: Create project task when sale order is confirmed
  • Follow-up: Schedule activity 7 days after quote sent if no response

Limitations

  • Complex logic may be slow — use Python code actions or custom methods for heavy operations
  • No error handling in code actions — wrap in try/except
  • Timed actions check once per cron interval (default: 4 hours, configurable)
  • Cannot trigger on computed field changes (only stored fields)

DeployMonkey

DeployMonkey's AI agent helps configure automated actions in natural language: "Send an email when an invoice is overdue by 15 days" → AI creates the automated action with correct trigger, filter, and email template.