unpaismejor-notification-whatsapp (8.0.18)
Installation
pip install --index-url https://code.unpaismejor.org.do/api/packages/tryton-do/pypi/simple/ --extra-index-url https://pypi.org/simple unpaismejor-notification-whatsappAbout this package
Reusable WhatsApp notifications for Tryton using Evolution API
Notification WhatsApp
Tryton 8.0 module for reusable WhatsApp templates and Evolution API.
Features
- Genshi templates bound to any Tryton model.
- Recipient fields or PYSON expressions with phone normalization.
- Any number of
ir.action.reportdocuments attached to a template. - Trigger and Tryton worker queue integration.
- Auditable text/document outbox and Evolution message identifiers.
- Manual sending from its menu and from the invoice form action.
- Independent attachment retries and idempotency keys.
- Authenticated delivery/read status webhook.
- Direct Evolution API v2 integration; n8n is optional.
Core compatibility
The module does not inherit the ir.email.template SQL model because doing
so would mix email-specific recipients, subject and SMTP fields with WhatsApp
records. Instead it follows the same composition used by
notification_email:
- template context, PYSON evaluation, recipient models and languages are
delegated dynamically to
ir.email.template; - documents are standard
ir.action.reportrecords and are executed using the same result contract as notification email attachments; ir.triggeractions and delayed jobs use Tryton's native queue proxy;- the outbox uses
ResourceAccessMixinlike the coreir.emaillog; whatsapp_models,_get_number,get_providerand reportgetare stable extension hooks for optional modules.
Installation
Install the package, update the Tryton module list and activate
Notification WhatsApp. Configure the endpoint, instance and API key under
Administration > Models > WhatsApp. Keep the API key restricted to the
WhatsApp Administration group.
Configure Evolution API to send message-update events to::
https://TRYTON_HOST/DATABASE/notification-whatsapp/webhook
The request must contain the configuration's secret in the
X-Webhook-Secret header. The endpoint accepts Evolution's sent, delivered,
read and error states. Enable Evolution's MESSAGES_UPDATE event and add
X-Webhook-Secret as a custom webhook header with the same value stored in
Tryton. DELIVERY_ACK fills Delivered At and READ/PLAYED fills
Read At (and Delivered At when the delivery event arrived late or was
omitted). Administrators are automatically assigned to both the
WhatsApp Administration and WhatsApp Sender groups. Regular operators must be
assigned to WhatsApp Sender explicitly.