--- title: Quote to Invoice url: https://blog.guigpap.com/en/workflows/quote-to-invoice/ url_md: https://blog.guigpap.com/en/workflows/quote-to-invoice.md category: automation date: '2026-03-28' maturite: production techno: - n8n - odoo application: - automation - business --- # Quote to Invoice > Automatic transformation of confirmed Odoo quotes into invoices with Telegram notification ## 1. What? — Definition and context In Odoo, when a customer accepts a quote (sale.order moves to "sale" state), an invoice has to be created, possibly validated, and sometimes emailed. This workflow automates the chain: as soon as the quote is confirmed, the invoice is created and a Telegram notification fires if the amount crosses a configurable threshold. > **Note - Sale Order → Invoice** > > In Odoo, a **sale.order** is a quote. When the customer accepts, its state moves to "sale" (confirmed). The invoice (`account.move`) is a separate accounting document that must be created from the quote — that step is what this workflow automates. --- ## 2. Why? — Stakes and motivations ### Problems solved | Problem | Without automation | With automation | |---------|--------------------|-----------------| | **Invoicing forgotten** | Quote confirmed, invoice never created | Automatic creation | | **Invoicing delay** | Invoice 3 days after confirmation | Instant | | **No visibility** | Discover the sale inside Odoo | Instant Telegram notification | --- ## 3. How? — Technical implementation ### Architecture ```mermaid flowchart TD Sale["sale.order · state → sale"] Action["Odoo Automated Action"] Webhook["N8N webhook /odoo/sale-confirmed · internal"] subgraph Workflow["Quote-to-Invoice workflow"] direction TB CheckDup["Check duplicate invoice"] Create["Create account.move · Odoo XML-RPC"] Post{"auto_post enabled?"} Validate["Validate invoice"] Email{"auto_send_email enabled?"} Send["Send invoice email"] Threshold{"amount > threshold EUR?"} end Hub["Notification Hub"] Sale --> Action --> Webhook --> CheckDup --> Create --> Post Post -->|Yes| Validate --> Email Post -->|No| Email Email -->|Yes| Send --> Threshold Email -->|No| Threshold Threshold -->|Yes| Hub ``` ### Trigger An Odoo Automated Action watches `sale.order` records moving to "sale" and posts an internal webhook to N8N. ### Journey 1. **Verification** — The workflow checks that no invoice already exists for this quote (duplicate prevention) 2. **Creation** — Odoo XML-RPC call to create the invoice (`account.move`) from the `sale.order` 3. **Auto-post** (optional) — If `auto_post` is enabled, the invoice moves from draft to validated 4. **Email send** (optional) — If `auto_send_email` is enabled, the invoice email is sent to the customer 5. **Notification** — If the amount crosses the threshold (default: 1000 EUR), a Telegram notification is sent ### Configuration | Parameter | Default | Description | |-----------|---------|-------------| | `auto_post` | false | Automatically validate the invoice | | `auto_send_email` | false | Send the email to the customer | | `notification_threshold` | 1000 | Telegram notification threshold (EUR) | > **Caution - Internal webhook** > > The `/webhook/odoo/sale-confirmed` webhook is blocked by Caddy from the public Internet. Only the Odoo container can call it through the Docker internal network. --- ## 4. What if? — Outlook and limits ### Current limits | Limit | Impact | Mitigation | |-------|--------|------------| | **No accounting validation** | Invoice auto-posted without review | `auto_post` disabled by default | | **Fixed threshold** | Same threshold for every customer | Configurable per workflow | ### Evolution scenarios **If manager validation is needed**: - Use the [Approval Workflow Hub](/en/workflows/approval-workflow/) for amounts above X - [Validate] button in Telegram before posting --- ## Related pages ### Workflows - [CRM Pipeline](/en/workflows/crm-automation/) — Upstream sales pipeline - [Website Lead Notification](/en/workflows/website-lead-notification/) — Web form leads - [Notification Hub](/en/workflows/notification-hub/) — Notification routing ### Infrastructure - [Odoo 18 on Docker](/en/infrastructure/odoo-18-setup/) — Invoicing and accounting ## Metadonnees agent - Cet article est issu du blog GuiGPaP Lab. - Contexte global du blog: https://blog.guigpap.com/llms.txt - Contact auteur: https://odoo.guigpap.com/mon-cv - Licence: CC-BY-SA 4.0