Hello everyone,
I'm trying to create a simple automated action in Odoo 19 to update the CRM stage of an opportunity when its related Sales Order (quotation) is sent by email.
Expected behavior:
When I click “Send by Email” on a quotation, the Sales Order state becomes “sent”, and the linked opportunity should automatically move to the stage “Devis envoyé” (Quotation Sent).
But the automated action never triggers, and the CRM stage never updates.
What I have done
Automated Action settings
Model: Sales Order (sale.order)
Trigger: On creation & update
Before update domain: All records
Apply on: state = sent (in the UI = “Soumission envoyée”)
On Update Fields: tried with and without selecting state
Action: Execute Python Code
Action is active
Python code used (no errors):
stage = env['crm.stage'].search([('name', '=', 'Devis envoyé')], limit=1)
for order in records:
if not order.opportunity_id:
continue
if order.state == 'sent' and stage:
order.opportunity_id.write({'stage_id': stage.id})
What is happening
Sending the quotation DOES change the Sales Order state to “sent”, confirmed in the UI.
The quotation IS linked to an opportunity (opportunity_id is not empty).
The automated action never triggers.
No error appears in the logs or UI.
Even a debug automated action that only does: order.message_post(body="DEBUG")
…does not post anything in the chatter.
This tells me the automated action is simply not running at all, even with no domains or filters.
What I have confirmed
Action is active.
Model is correct (sale.order).
The “sent” state corresponds to the value "Soumission envoyée” in the UI.
I tried versions with and without domains.
I tried “On update”, “On creation & update”, and “On update of field: state”.
Nothing triggers the action.
My questions
Is there a known issue in Odoo 19 where automated actions do NOT trigger on Sales Orders when the state changes from draft to sent?
Should "Send by Email" trigger an automated action on Sales Orders?
Does the email wizard update the record in a way that bypasses automated actions?
Is there another method recommended to react to the quotation being sent?
Is there a limitation in Odoo 19 Online / Enterprise that prevents some automated actions from executing?
Any help would be greatly appreciated
I’m simply trying to update the CRM stage when a quotation is sent — something that several Odoo forum posts suggest should work — but the automated action never fires, even with zero domain filters and a basic message_post() debug.
