Skip to content
Tutorials Center
My learning

Topics

Lesson 13 of 39 ยท Modules and Business Apps

From Quotation to Cash: One Workflow End to End

Follow one sale through Odoo: quotation, confirmation, delivery, invoice and payment. See the documents created at each step and where developers hook in.

Nothing explains Odoo's design better than watching one sale travel through it. In this lesson you follow a single order from quotation to payment, name the documents and models created at each step and mark the places where a developer usually adds code: extra fields, checks and automations.

The steps assume Sales, Inventory and Invoicing are installed with demo data. Everything in the screen walkthrough is read-only; the runnable part is a stand-in that models the flow in Python.

Step 0: the master data

Before the first order you need a customer (a res.partner) and at least one product. Two product settings decide how the flow behaves:

  • Product type decides whether stock is tracked. A goods product you can track moves a delivery; a service creates no delivery. (Terminology and exact options differ slightly between series, such as "storable" and "track inventory".)
  • Invoicing policy decides when the invoice can be created: on ordered quantities (as soon as the order is confirmed) or on delivered quantities (only after goods were shipped).

Step 1: the quotation

In Sales, create a new quotation: choose the customer, add lines with product and quantity, and optionally set payment terms and an expiry date. The record is a sale.order in the draft state. Prices come from a pricelist, taxes from the product and the customer's fiscal position, and totals are computed fields that update as lines change. Click Send by Email and the state changes to sent; the email goes through a template stored as data (an mail.template record).

Developer hook: computed fields, onchange methods and constraints on the order or its lines (chapter 4).

Step 2: confirmation

Confirm calls action_confirm(). It checks that the order is valid, sets the state to sale, may lock prices, and triggers follow-up work in other apps:

  • With Inventory: a delivery stock.picking is created, with one stock.move per goods line.
  • With Purchase and "Buy" routes: a request for quotation to a vendor may be created for products that are not in stock.
  • With Project: tasks can be created for service products.

This pattern, where one module overrides action_confirm to add behaviour and calls super(), is how most Odoo glue works. You will write one in chapter 4.

Step 3: delivery

The warehouse worker opens the delivery picking, checks the quantities and presses Validate. Validation moves the stock from the warehouse location to the customer location (stock.move records become done and stock.quant quantities change). If the invoicing policy is "delivered quantities", the order's "invoice status" now changes to To Invoice.

Step 4: invoice

Back on the order, Create Invoice opens a wizard (a temporary model) that asks whether to invoice everything, a percentage or a fixed amount. The result is an account.move with move_type = "out_invoice" linked to the order lines. Posting (Confirm on the invoice) numbers the invoice and creates the accounting entries if the accounting features are active.

Step 5: payment

Register Payment opens another wizard that creates an account.payment, which is then reconciled with the invoice. When the invoice's residual amount reaches zero its payment state becomes Paid. In Odoo Community this can be done manually; Enterprise adds bank statement import and automatic reconciliation.

Quotation to cash

Quotation sale.order in draft
Confirm state = sale
Deliver stock.picking validated
Invoice account.move posted

Four documents, one chain.

1 / 2

Linked documents

Every document keeps links to the previous one: the order shows smart buttons for Delivery and Invoice, the delivery knows its origin order and the invoice lines point back to the order lines. In code, these links are relational fields such as picking_ids and invoice_ids, and they let you navigate with dotted access in Python or in domains.

A runnable stand-in: the chain in code

This stand-in simulates the chain with a few classes. It shows what makes the flow robust: each document holds a reference to the previous one, and each step is a method that checks the current state.

Python Stand-in: quotation, delivery, invoice, payment

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Where developers customise this flow

  1. Fields: add a customer reference or delivery notes to sale.order; copy them to the delivery or invoice by overriding the method that creates those documents.
  2. Checks: refuse confirmation when the customer is over their credit limit (override action_confirm, raise an error).
  3. Automations: send a message or create an activity when an invoice is paid.
  4. Reports: change the quotation PDF or add a delivery slip layout (chapter 7).
  5. Access: let only the sales manager cancel confirmed orders (chapter 6).

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which button usually creates the delivery order in a standard Sales plus Inventory setup?

    action_confirm moves the order to the sale state and the stock glue module creates the picking.
  2. 2. What does the invoicing policy 'delivered quantities' mean?

    The order only becomes 'To Invoice' after the delivery picking has been validated.
  3. 3. What is the usual pattern for extending a button such as Confirm in your own module?

    You inherit the model, add your logic and call super() so the standard behaviour still runs.
  4. 4. Which model holds both customer invoices and vendor bills?

    account.move is distinguished by its move_type field.

Summary

  • A sale flows from quotation to confirmed order, delivery, invoice and payment; each step creates a linked document.
  • Product type and invoicing policy decide whether a delivery is needed and when to invoice.
  • Buttons are Python methods (action_confirm, wizards for invoice and payment) that you can extend.
  • Documents link to each other with relational fields, which you can follow in code and in reports.
  • Typical customisations are fields, checks, automations, reports and access rules.

Next: Module Lifecycle: Install, Update, Uninstall and Hooks