| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
Discuss (mail)
|
| Lines of code | 410 |
| Technical Name |
ahda_dynamic_whatsapp_client |
| License | LGPL-3 |
AHDA Dynamic WhatsApp Client
A fully configurable WhatsApp API client for Odoo,
supporting template-based messaging, partner targeting, and automation.
Key Features
- Define WhatsApp message templates with dynamic parameters
- Configure recipient logic using Python expressions
- Use
${...}expressions for dynamic parameter values - Integrate with WhatsApp API endpoints
- Log and track sent messages, with a smart button to view logs per API
- Dynamic method injection for models to enable WhatsApp messaging
How to Use
- Go to Settings → WhatsApp API to configure your WhatsApp API endpoint and headers.
- Go to Settings → WhatsApp Templates to create message templates.
- In the template form:
- Recipient: Enter a Python expression that returns a list or recordset of
res.partner(e.g.,obj.partner_ids). - Parameters: For type Expression, use
${...}expressions (e.g.,${obj.name}).
- Recipient: Enter a Python expression that returns a list or recordset of
- Trigger sending via automation or manually from the record:
- Use in automated rules:
- Go to Settings â Technical â Automation â Automated Actions
- Create a new automated action with your desired trigger (e.g., "On Create", "On Update")
- Set the action type to "Send Whatsapp API"
- Select the desired WhatsApp template in the "Whatsapp Template" field
- Use as action server, manually trigger:
- Go to Settings â Technical â Actions â Server Actions
- Create a new server action and set the model and action type to "Send Whatsapp API"
- Select the desired WhatsApp template in the "Whatsapp Template" field
- Add the server action to the model's "Action" menu or create a button
- Users can manually trigger WhatsApp messages from record forms
- Manual usage from any model (Python code):
- Just call
send_whatsapp_by_template('<Template Name>')on any recordset of the target model. - Works on single or multiple records (vectorized).
- The argument is the WhatsApp Template's Name for that model.
- Alternative: fetch the template and call
template.send(records). - Example:
# single record
self.send_whatsapp_by_template('Order Confirmation')
# For a batch of orders
orders = self.env['sale.order'].search([('state', '=', 'sale')])
orders.send_whatsapp_by_template('Order Confirmation')
- Just call
- View logs for each WhatsApp API by clicking the smart button in the API form.
- Use in automated rules:
Available Variables in Templates
obj: The current record (same asobject)partner: The recipient partner (from the recipient expression)phone: The recipient's phone numberctx: The Odoo context
Contact Us:
AHDA Tech Solution, Jakarta
Odoo Consultation, Customization, and Implementation
ahdasolution@gmail.com
Jakarta, Indonesia
AHDA Tech Solution, Jakarta
Odoo Consultation, Customization, and Implementation
ahdasolution@gmail.com
Jakarta, Indonesia
Please log in to comment on this module