Skip to content
Tutorials Center
My learning

Topics

Lesson 12 of 39 ยท Modules and Business Apps

The Standard Business Apps

A developer's tour of Odoo's core apps and models: contacts, products, sales, purchase, inventory and invoicing, with the model names you will meet in code.

If you customise Odoo you will spend most of your time extending the standard apps, so you need a mental map of them: what each app is for, which models it owns and how a document flows from one app to the next. This lesson is that map. You do not need to memorise every field; you need to know which names to search for when a customer says "add a field to the delivery slip".

Module and model names below are stable across recent series, but some fields and states change between versions. When writing code, confirm names in the Technical menu of developer mode or in the source code of your installed version.

The shared foundation

Three building blocks appear in almost every app:

  • res.partner (Contacts): people, companies and addresses. Customers, vendors and employees' private addresses are all partners. Because everything points to it, adding a field to res.partner makes it available everywhere.
  • product.template and product.product: a template is the product as users think of it ("T-shirt"); a product (variant) is a specific combination ("T-shirt, blue, size M"). Without variants, one template has exactly one product.
  • res.company, res.users, res.groups: the organisation, the people who log in and the permission groups.

The sales cycle

flowchart LR
    L["crm.lead<br/>Opportunity"] --> Q["sale.order<br/>Quotation"]
    Q -->|"Confirm"| SO["sale.order<br/>Sales Order"]
    SO --> P["stock.picking<br/>Delivery"]
    SO --> I["account.move<br/>Customer Invoice"]
    I --> PAY["account.payment"]

One chain of documents: each step creates the next one in another app.

  1. CRM tracks leads and opportunities (crm.lead) in a pipeline.
  2. Sales turns an opportunity into a quotation: a sale.order in the draft state, with order lines (sale.order.line) naming products, quantities and prices.
  3. When the customer accepts, Confirm switches the order to the sale state. This is a Python method, action_confirm, on the model.
  4. If Inventory is installed (via the glue module sale_stock), confirming creates a delivery order, a stock.picking, with stock moves for each line.
  5. Invoicing creates an invoice, an account.move, either before or after delivery, depending on the product's invoicing policy.
  6. A payment is registered and reconciled against the invoice.

The purchase cycle

Purchasing mirrors it: a request for quotation (purchase.order) is sent to a vendor, confirmed into a purchase order, received into stock as a stock.picking of type receipt, and the vendor bill is another account.move. Replenishment rules and reordering rules can create these orders automatically when stock falls below a minimum.

Inventory in a nutshell

  • Warehouses and locations form a tree. Stock "exists" in a location; moving stock means creating a stock.move from one location to another.
  • A picking (transfer) groups moves: receipts, deliveries and internal transfers are all pickings with a different operation type.
  • Quantities (stock.quant) record how much of a product is in each location, with optional lots and serial numbers.
  • Valuation records the cost of stock for accounting (Accounting integrates with Inventory via valuation entries).

Accounting

In Odoo, invoices, bills, credit notes and journal entries are all the same model: account.move, distinguished by the field move_type (for example out_invoice for a customer invoice and in_invoice for a vendor bill). Its lines are account.move.line records, each with an account, a debit or credit, and often a partner. The Community edition offers invoicing and basic accounting features; the Enterprise edition has the full accounting suite. Plan your customisations accordingly.

Other common apps

App Main models Typical use
Project project.project, project.task Tasks, stages, timesheets
Website / eCommerce website, website.page Public site, shop
Point of Sale pos.order, pos.session Retail terminals
Manufacturing mrp.production, mrp.bom Bills of materials, production orders
Human Resources hr.employee, hr.leave Staff files, time off
Discuss discuss.channel, mail.message Chat and notifications

Several of these apps are Enterprise-only in some editions, or have Community and Enterprise variants; check the Apps list of your installation.

Seeing the models from Python

In an Odoo shell, you could explore the sales cycle like this (real Odoo code, read-only; the exact output depends on your data):

Python
order = env["sale.order"].create({
    "partner_id": env.ref("base.res_partner_1").id,
    "order_line": [(0, 0, {"product_id": env.ref("product.product_product_4").id,
                           "product_uom_qty": 2})],
})
order.action_confirm()
print(order.state)            # 'sale'
print(order.picking_ids)      # deliveries, if Inventory is installed
print(order.invoice_ids)      # empty until an invoice is created

A runnable stand-in: an order state machine

The behaviour at the heart of every document is a state machine: a field state with allowed transitions, and methods that change it and trigger side effects. The next stand-in models a simplified sales order. Odoo's real order has more states and checks, but you will find the same pattern in nearly every business model.

Python Stand-in: a sales order state machine

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.

A second stand-in: totals per customer

Reports often group documents per partner. This stand-in groups order totals, the same job a read_group call does in Odoo's ORM (chapter 4 shows the real API).

Python Stand-in: group order totals by partner

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.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which model stores customers, vendors and addresses?

    res.partner is shared by all apps, so a field added there is available everywhere.
  2. 2. Customer invoices and vendor bills are stored in which model?

    Modern Odoo uses account.move for invoices, bills, credit notes and journal entries.
  3. 3. What does confirming a quotation typically do when Inventory is installed?

    action_confirm changes the state and the glue module creates the stock picking.
  4. 4. What is the difference between product.template and product.product?

    A template can have several variants; each variant is a product.product.

Summary

  • Contacts (res.partner), products and users are the shared foundation of all apps.
  • A sales order flows to delivery (stock.picking) and invoice (account.move) through glue modules.
  • Purchasing mirrors sales; Inventory moves stock between locations with stock.move.
  • Invoices, bills and journal entries share account.move.
  • Documents are state machines: a state field plus action methods.

Next: From Quotation to Cash: One Workflow End to End