Why Integrate SMS with Odoo?
Odoo is one of the most flexible ERP platforms available — covering Sales, CRM, Inventory, Accounting, Manufacturing, and HR in a single suite. Adding SMS turns Odoo into a customer communication hub that automatically triggers messages on every important business event: order confirmations, invoice dispatch, delivery notifications, payment reminders, and CRM lead follow-ups.
This guide covers two integration methods — using Odoo's built-in SMS Gateway module (no-code) and using Server Actions with custom Python (for advanced workflows).
Sales Order SMS
Auto-confirm orders, dispatch updates, and delivery alerts to customers from the Sales module
Invoice & Payment
Send invoice notifications and payment receipts triggered by accounting events
Delivery Tracking
SMS shipment dispatch, delivery OTP, and ETA updates from Inventory and Stock modules
CRM Lead Alerts
Notify sales reps via SMS on new lead capture, status changes, and pipeline updates
Before You Begin
Make sure you have these ready:
- An Odoo installation (Community or Enterprise, version 14 or higher recommended)
- Admin access to the Odoo instance with rights to install modules and configure Server Actions
- A SpringEdge SMS account with API access — sign up free
- Your SpringEdge API key from the dashboard
- A DLT-approved sender ID (e.g.
SEDEMO) - A DLT-approved SMS template for each event you want to automate
Method 1: Send SMS Using Odoo Server Actions (Recommended)
Use Odoo's built-in Server Actions + Automated Actions to call the SpringEdge SMS API on any business event — no custom module needed.
Step 1: Enable Developer Mode
Server Actions require Developer Mode. Go to Settings → Activate the developer mode (link at the bottom of the General Settings page).
Step 2: Create an Automated Action
Navigate to Settings → Technical → Automation Rules (or "Automated Actions" in older versions). Click New and configure:
- Action Name: e.g. "Send SMS on Sale Order Confirmation"
- Model: The Odoo model you want to trigger from —
sale.orderfor sales orders,account.movefor invoices,stock.pickingfor deliveries - Trigger: "On Update" or "Based on Form Modification"
- Apply on: Filter conditions, e.g.
state = salefor confirmed orders - Action To Do: "Execute Python Code"
Step 3: Add the Python Code
In the "Python Code" field, paste this script (replace API key, sender, and template text with your values):
# Send SMS via SpringEdge API on Sale Order Confirmation
import requests
from urllib.parse import quote
API_KEY = "YOUR_SPRINGEDGE_API_KEY"
SENDER = "SEDEMO"
# Pull data from triggering record
order = record # The sale.order record that triggered this
phone = order.partner_id.mobile or order.partner_id.phone
name = order.partner_id.name
order_no = order.name
total = order.amount_total
if phone:
# Build SMS text (must match DLT template)
message = (
f"Hi {name}, your order {order_no} "
f"for Rs.{total} has been confirmed. "
f"Thank you for shopping with us. - SEDEMO"
)
# Call SpringEdge SMS API
url = "https://web.springedge.com/web/api/send/"
params = {
"apikey": API_KEY,
"sender": SENDER,
"to": phone.replace("+", "").replace(" ", ""),
"message": message,
}
try:
response = requests.get(url, params=params, timeout=10)
log("SpringEdge SMS sent: %s" % response.text)
except Exception as e:
log("SpringEdge SMS error: %s" % str(e))
Note: Odoo's Python sandbox restricts certain modules. If requests is unavailable, use Odoo's requests wrapper or call self.env['ir.http']._request. Alternative: use an HTTP client built into Odoo.
Step 4: Save and Test
Save the Automated Action and ensure it's set to Active. Confirm a test sale order with a contact that has a valid Indian mobile number. Within 3-5 seconds, the customer should receive the SMS. Verify delivery in your SpringEdge dashboard.
Method 2: Build a Custom Odoo Module
For production-grade integration with logging, retries, and template management, build a small custom Odoo module.
A custom module gives you:
- Reusable SMS service that any other module can call
- SMS log table to track every send (delivered, failed, retried)
- Configurable templates per event type
- Settings page in Odoo admin for API key, sender, defaults
- Security ACLs — control which users can send SMS
Create a module folder with __manifest__.py + models/sms_service.py and add a service class that wraps SpringEdge's API. Import it in any other module like self.env['springedge.sms'].send(phone, message).
# models/sms_service.py
from odoo import models, fields, api
import requests
import logging
_logger = logging.getLogger(__name__)
class SpringEdgeSms(models.AbstractModel):
_name = 'springedge.sms'
_description = 'SpringEdge SMS Service'
@api.model
def send(self, phone, message):
"""Send SMS via SpringEdge API.
Returns True on success, False on failure.
"""
config = self.env['ir.config_parameter'].sudo()
api_key = config.get_param('springedge.api_key')
sender = config.get_param('springedge.sender')
if not api_key or not sender:
_logger.error('SpringEdge config missing')
return False
url = 'https://web.springedge.com/web/api/send/'
try:
r = requests.get(url, params={
'apikey': api_key,
'sender': sender,
'to': phone,
'message': message,
}, timeout=10)
_logger.info('SMS sent: %s', r.text)
return r.status_code == 200
except Exception as e:
_logger.error('SMS failed: %s', e)
return False
What You Can Automate from Odoo
Popular SMS workflows businesses run from Odoo modules.
Sale Order Confirmation
Customer SMS on order confirmation with order number, total, and expected delivery date from the Sales module.
Invoice Dispatch
Auto-SMS customers on invoice creation from the Accounting module with invoice number, amount, and due date.
Delivery Notifications
Trigger SMS when a stock picking is validated — dispatch alerts, tracking info, and delivery OTP from Inventory module.
Payment Receipts
Instant SMS to customers when payment is registered against an invoice in the Accounting module.
CRM Lead Alerts
SMS sales reps when new leads enter the CRM pipeline or when high-value opportunities reach a critical stage.
Appointment Reminders
SMS customers and field service technicians for scheduled appointments using the Field Service module.
HR & Payroll
SMS employees on leave approvals, payslip generation, and shift reminders from the HR and Payroll modules.
POS Receipts
Send SMS receipts to customers from the Point of Sale module on successful checkout.
Troubleshooting Common Issues
If SMS isn't going out from Odoo, check these.
Action Not Triggering
Verify the Automated Action is Active, the model and trigger event are correct, and any "Apply on" filter conditions are met.
SMS Blocked by Operator
Compare the actual SMS text exactly with your DLT-approved template — including punctuation, spacing, and variables. Mismatches cause blocking.
Phone Number Format
Odoo stores phones with country code prefix and sometimes spaces. Strip +, spaces, and hyphens before passing to the API: 919876543210.
Sandbox Restrictions
Odoo's Python sandbox restricts some modules. If requests is blocked, use Server Action with a separate cron-triggered queue, or build a custom module with full Python access.
Missing Mobile Number
If partner_id.mobile is empty, the SMS won't send. Add a check before calling the API and log the skipped record.
Sender ID Not Approved
The sender ID must be DLT-approved on your telecom DLT account. Unregistered headers are blocked at telecom operator level.
Frequently Asked Questions
Common questions about Odoo SMS integration.
-
How do I send SMS from Odoo?
The fastest way is to create an Automated Action in Odoo (Settings → Technical → Automation Rules) that triggers a Python Server Action calling the SpringEdge SMS API. Configure the trigger model (sale.order, account.move, etc.), set the trigger event, and paste the Python script that calls the API. For production-grade integration, build a small custom module with a reusable SMS service.
-
Does Odoo Community edition support SMS integration?
Yes. The Automation Rules / Server Actions approach works on both Odoo Community and Enterprise editions. The built-in SMS module (which uses Odoo's IAP service) is enterprise-focused and uses Odoo credits, but for SpringEdge integration, the Server Action approach works regardless of edition.
-
Which Odoo modules can trigger SMS?
Any Odoo module exposes its records through Automation Rules. Common ones: Sales (
sale.order), Accounting (account.move), Inventory (stock.picking), CRM (crm.lead), POS (pos.order), Field Service (project.task), HR (hr.employee,hr.leave), Subscription, Repair, Manufacturing — all support triggered SMS. -
Is DLT compliance required for SMS from Odoo?
Yes. All SMS to Indian mobile numbers must use a DLT-approved sender ID and a DLT-approved message template. This applies regardless of how SMS is sent. Make sure your Python code's message text matches the registered template exactly — otherwise telecom operators will block the SMS.
-
Why is my Odoo SMS not sending?
Most common reasons: (1) Automation Rule is inactive, (2) "Apply on" filter doesn't match the record, (3)
partner_id.mobileis empty, (4) phone number format is wrong (has + or spaces), (5) message text doesn't match DLT-approved template, (6) sender ID is not DLT-registered, or (7) Odoo's Python sandbox is blockingrequests. Check Odoo logs and your SpringEdge dashboard for clues. -
Can I send bulk SMS from Odoo to a contact list?
Yes. Build a custom Odoo wizard that filters contacts (by tag, country, customer category, etc.), then loops through the selection and calls the SpringEdge SMS API for each contact. For very large lists, queue the sends through Odoo's job queue (
queue_jobmodule) to avoid timeouts. -
Can I track SMS delivery status in Odoo?
Yes. Two ways: (1) Build a webhook controller in your custom module that receives SpringEdge delivery report (DLR) callbacks and updates an SMS log model in Odoo. (2) Or just check delivery status in your SpringEdge dashboard. For most SMB use cases, the dashboard view is enough — build the webhook only if you need delivery status tied to specific Odoo records.
