Architecture of Odoo
How Odoo Works
A simple mental model for Sales & Functional Consultants
Tech StackData FlowData TypesACL
1. Tech Stack
What is Odoo built with?
User Interface, Python, ORM, and Database work together to deliver ERP functionality.
Odoo stack
π₯οΈ
User Interface
Technology: XML + OWL (JavaScript)
Forms β’ Buttons β’ Lists β’ Dashboards
β
π
Python
Purpose: Business logic
Validation β’ Workflow β’ Automation
β
π
ORM
Meaning: Object Relational Mapping
Connects Models β Database
β
ποΈ
Database
Technology: PostgreSQL
Stores Customers β’ Orders β’ Invoices β’ Inventory
What each layer contributes
UI
User InterfaceMakes Odoo easy for users to operate.Forms, buttons, lists, dashboards.
PY
PythonImplements business requirements.Validation, workflow, automation, calculations.
ORM
ORMSimplifies access to business data.Connects Odoo models with the database.
DB
DatabaseKeeps reliable shared business data.One source of truth for all modules.
Each layer has one responsibility. Together they deliver a complete ERP system.
2. Data Flow
How does Odoo process my click?
MVC explains how Odoo turns one user action into a controlled business process.
MVC in Odoo β mapped to the Tech Stack
π₯οΈ
ViewShows what users see and interact with: forms, buttons, lists, dashboards.
UI
β
βοΈ
ControllerReceives the request from the browser and sends it to the right logic.
PY
β
π¦
ModelApplies business rules, validations, calculations, and workflows.
PY
β
π
ORMTranslates business objects into database operations.
ORM
β
ποΈ
DatabaseStores the data and related business records.
DB
Example: Confirm Sales Order
1
View: click ConfirmThe salesperson clicks the Confirm button on the Sales Order form.
2
Controller: receive requestOdoo receives the browser request: βconfirm this orderβ.
3
Model: apply business rulesThe Sales Order model checks customer, pricing, taxes, stock logic, and workflow.
4
ORM: translate & saveThe ORM converts the business object into database operations.
5
Database: store resultPostgreSQL stores the order and related records are updated.
Sales Order Confirmed
Inventory Received
3. Data Types
How is business data organized?
Models store information using fields and relationships that mirror real-world business entities.
Common field types
π CharShort text, like customer name
π TextLong notes or descriptions
π’ IntegerWhole numbers, like quantity
π² FloatDecimals, like discount %
π° MonetaryCurrency amounts, like total
π
DateOrder date or deadline
π SelectionOptions, like Draft / Confirmed
β
BooleanYes / No, like Paid?
Example: Sales Order Total uses Monetary because it stores a currency amount.
Relationships
π€ Customer
Many2One (M2O)
π Sales Order
One2Many (O2M)
π Order Lines
Many2Many (M2M): Products β Tags
Key message: field types store the right kind of information; relationships connect business objects together.
4. ACL
Who can see or modify data?
Security is controlled through Users, Groups, ACLs, Record Rules and Field Groups to enforce business policies.
π€
UserWho is logging in?
β
π₯
GroupWhat is their role?
β
β
π
Record RuleWhich records can they access?
β
π
Field GroupsWhich fields can they see?
Business example
John is a Sales User. He can create and edit quotations, but only for his own customers or sales orders.
β’ ACL controls actions: read, create, edit, delete
β’ Record Rules control visibility: own records or company records
β’ Field Groups control visibility: specific fields within records
Key message: Odoo controls both what users can do and which data they can see.
Summary
Four ideas to remember
Odoo architecture is easier when we connect every technical concept to one business action.
Tech StackOdoo uses User Interface, Python, ORM, and Database to turn user actions into business data.
Data FlowA click moves through View, Controller, Model, ORM, and Database to trigger business results.
Data TypesModels, fields, and relationships organize business data.
ACLUsers, Groups, ACLs, and Record Rules protect business data.
Any question ? Please keep it yourself !
Part 2 Β· Odoo Studio & Automation
Click first.
Code only when needed.
A practical extension: how Studio, fields, and automation help consultants build small solutions directly inside Odoo.
StudioFieldsAutomationBest Practices
Studio & Automation
What will we cover?
Three practical topics, then a small exercise to prove the concept.
- 01 Β· Build via Studio β what it is, what it can do, and where it cannot go.
- 02 Β· Add a Field β field palette, attributes, group visibility, and relational fields.
- 03 Β· Automation & Scheduled Actions β react to events or run on a timer.
- 04 Β· Hackathon β two groups, one local server, one field and one automation each.
Build via Studio
A construction kit for screens you already use
Studio opens an edit sidebar over the live Odoo screen. No Python deployment is needed for simple UI changes.
How it feels to use
+ Drop a field here
WHEN stage β Done THEN email Project Manager
Studio
οΌ Add field
β Automation
β Approval
β€ Report
Simple definition
Studio lets users customize views, fields, reports, and simple automations directly from the browser.
Key message: Studio is useful for fast, small, local changes. It is not a replacement for development.
Studio Capabilities
What can you do in Studio?
Studio touches six main areas. The most important for consultants are views, fields, automation, and small apps.
π§± Views & Layout Today
- Add, remove, or reposition fields.
- Add tabs, groups, statusbars, or buttons.
π·οΈ Fields & Data Today
- Create text, number, date, selection, many2one, related fields.
- Make fields required, read-only, or hidden.
βοΈ Automation Today
- When X happens, do Y.
- Add approval rules before a button can be clicked.
π Reports
- Edit PDF report layout.
- Add or remove fields, logos, and sections.
π§© New Apps & Menus Today
- Create a mini-app from a blank model.
- Add menu items in existing apps.
π Filters & Search
- Add default filters and group-by options.
- Search using new custom fields.
Before Studio
Before you build, check what already exists
Studio should not be the first answer for every request.
1 Β· Native?Check Odoo Apps first: Helpdesk, Field Service, Fleet, Maintenance, Documents, Sign, Subscriptions, and more.
2 Β· Apps StoreLook for official or third-party apps that already solve the problem.
3 Β· OCASearch community modules before creating a new customization.
4 Β· StudioIf nothing fits and the need is small/local, Studio earns its place.
OCAMiddle option: Community modules can solve features that Studio cannot build, without starting full custom development.
Studio Limits
Where Studio cannot work well
Studio is powerful, so we need a clear boundary before a quick tweak becomes technical debt.
Where it cannot go
β’ No complex business logic beyond simple conditions.
β’ Cannot call external systems or APIs properly.
β’ Not suitable for performance-sensitive changes.
β’ Does not manage ACLs or Record Rules.
β’ Easy to overuse because every change becomes permanent metadata.
Escalation path
Studio Try first
β if not enough
OCA Module Try second
β still not enough
Custom Development Escalate
Rule of thumb: Studio for small, local, cosmetic changes. Development for multi-team impact, integrations, and real business logic.
Add a Field
Field types: one palette, many business meanings
When you add a field in Studio, you are extending a model with a new piece of business data.
Text / CharNames, references, short labels
Integer / FloatQuantities, scores, percentages
MonetaryCurrency amounts with a currency field
Date / DatetimeDeadlines, appointment time, confirmation date
SelectionFixed options like Low / Medium / High
BooleanYes / No flags
Many2OneLink one record to another record
One2Many / Many2ManyConnect lists of related records
Key message: choosing the right field type makes reports, filters, and automation much easier later.
Field Configuration
Every field gets the same five important switches
Attributes define how users can interact with a field.
Common switches
β’ Required β user must fill it before saving.
β’ Read-only β user can see it but cannot edit it.
β’ Invisible β hidden from the screen.
β’ Placeholder / Help β guide users on what to enter.
β’ Default value β pre-fill common information.
Business example
If a quotation is already confirmed, some fields should become read-only so users do not accidentally change important commercial data.
Visibility by Group
Not everyone needs to see every field
Studio can show or hide fields by group, but real security still belongs in Technical Settings.
Visibility example
| Field | Sales User | Sales Manager |
|---|
| Customer Notes | | |
| Internal Margin | | |
Important distinction
Hiding a field is a UI decision. It improves usability, but it is not the same as database-level security.
Use ACL and Record Rules when the requirement is real security.
Relational Fields
Fields that point to another model
Many business requirements are not just about storing data, but connecting records together.
Simple relationship map
π€ Customer
Many2One
π Sales Order
One2Many
π Order Lines
Many2Many: Products β Tags
How to explain it
β’ Many2One: one Sales Order has one Customer.
β’ One2Many: one Customer has many Sales Orders.
β’ Many2Many: many Products can have many Tags.
Automation
Rules that run themselves
Automation is where Odoo reacts automatically after records are created, updated, or scheduled.
Trigger
Something happens
β
Action
Odoo does something
β
Result
Business process continues
Automated Action
Runs when a record changes, for example when a ticket moves to a new stage.
Scheduled Action
Runs on a timer, for example every night to send reminders or update statuses.
Automation Rule
Trigger, conditions, then actions
A rule should be readable as a business sentence: when this happens, and the record matches these conditions, do this action.
ModelHelpdesk Ticket
TriggerOn update
ConditionStage is Waiting and last update is older than 2 days
ActionSend reminder email to responsible person
Domain example
[('stage_id.name', '=', 'Waiting'),
('write_date', '<', today - 2)]
Domain = filter that decides which records the rule applies to.
Automation Actions
Clicking Add an action opens the same logic every time
After Odoo finds the right records, actions decide what happens next.
Common actions
β’ Send an email or activity.
β’ Update a field.
β’ Create another record.
β’ Add a follower or notification.
β’ Run server action for advanced cases.
Example chain
Ticket idleβCreate activityβEmail ownerβManager sees risk
Scheduled Action
Scheduled Action = automation on a timer
A scheduled action runs periodically, even when no user clicks anything.
When to use it
β’ Nightly digest email.
β’ Remind users about overdue tickets.
β’ Sync or clean up records.
β’ Recalculate scheduled information.
Simple memory
Automated Action reacts to a record event.
Scheduled Action runs based on time.
Event-based vs time-based automation.
Demo Scenario
Ticket idle 2 days β reminder + nightly digest
This example shows how automation turns a business policy into an Odoo process.
Business requirement
If a support ticket stays idle for more than two days, remind the responsible person and include it in a nightly manager digest.
Odoo solution
Find idle ticketsβCreate activityβSend emailβDigest list
Key message: automation helps enforce follow-up without depending on someone remembering manually.
Exercise
Build it yourselves
Two groups, one local server, one custom field and one automation each.
Group task
- Create one useful custom field.
- Make it visible in the right place.
- Create one automation rule.
- Test with a real record.
Success criteria
β’ The field supports a real business need.
β’ The automation has a clear trigger.
β’ The result is easy to explain to a consultant.
Studio Summary
Three things to remember
Studio is fastUse it for small UI, field, report, and local process changes.
Fields shape dataChoose the right field type so reporting and automation work naturally.
Automation enforces processUse triggers and scheduled actions to reduce manual follow-up.
Know when to escalateUse OCA or custom development for integrations, complex logic, and multi-team impact.
Studio helps consultants prototype and deliver small business improvements faster.