Enable Dark Mode!
how-to-configure-simple-and-approval-workflows-in-odoo-19.jpg
By: Ayana R

How to Configure Simple and Approval Workflows in Odoo 19

Technical Odoo 19 Odoo Enterprises Odoo Community

Workflows are essential for defining how business records progress through different stages in a system. In Odoo 19, workflows represent the lifecycle of transactions and documents, helping to control transitions between states and ensuring actions are performed by the right users at the right time. Unlike earlier versions that used a legacy workflow engine, Odoo 19 implements workflows through states, buttons, access controls, automated actions, and approval logic.

In this article, we explore the concept of workflows in Odoo 19 and walk through two common patterns: Simple Workflows and Approval Workflows. Practical code examples and explanations are included to help developers and implementers understand how to use workflows effectively in real projects.

What Are Workflows in Odoo 19?

In Odoo, a workflow defines the path a record follows from creation to completion. This path is controlled by state fields and corresponding actions. When users interact with records—such as confirming a sales order or submitting a bill for approval—the system changes the state accordingly and triggers business logic.

Workflows in Odoo 19 depend on Selection fields that represent states, Python methods to switch states, UI buttons to invoke these methods, and access control rules that restrict who can perform which transitions. The flexibility of this approach allows both simple and complex business processes to be automated seamlessly.

Simple Workflows

Simple workflows model straightforward processes where a record moves linearly between states without needing formal approval steps. These workflows are most suitable for operational transactions where speed is more important than multi-level control.

For example, the sales order process can include stages such as Draft > Confirmed > Done > Cancelled. Users with appropriate rights can move records along this path without waiting for authorizations.

A basic state field in the model can be defined as follows:

state = fields.Selection([
    ('draft', 'Draft'),
    ('confirm', 'Confirmed'),
    ('done', 'Done'),
    ('cancel', 'Cancelled'),
], default='draft')

Actions to change these states are exposed as model methods and tied to UI buttons:

<button name="action_confirm"
        string="Confirm"
        type="object"
        states="draft"/>

When the user clicks Confirm, the state changes from draft to confirm, and any business rules defined in the method are executed.

def action_confirm(self):
   self.state = 'confirm'

Simple workflows are easy to implement, requiring minimal code and straightforward access control. Their main advantage is fast processing for high-volume tasks.

Approval Workflows

Approval workflows introduce controlled transitions that require authorization before progressing. These are used in business scenarios involving compliance, budgets, risk, or audit trails—for example, vendor bill approvals or purchase orders exceeding a threshold.

An approval workflow uses additional states like Submitted, Approved, and Rejected. Only users with designated roles or groups can validate transitions between these states.

Consider a vendor bill approval process. The state field might be:

state = fields.Selection([
    ('draft', 'Draft'),
    ('submitted', 'Submitted'),
    ('approved', 'Approved'),
    ('posted', 'Posted'),
    ('rejected', 'Rejected'),
], default='draft')

Users submit bills for approval:

def action_submit(self):
    self.state = 'submitted'

Approvers can authorize the bill using:

def action_approve(self):
    if not self.env.user.has_group('account.group_account_manager'):
        raise UserError("Only Managers can approve.")
    self.state = 'approved'

The UI restricts visibility of the Approve button to members of the accounting manager group, ensuring appropriate control. This approach makes workflow states more explicit and traceable, which is essential for compliance and audit purposes.

Simple vs Approval Workflows

In general, simple workflows emphasize speed and minimal restrictions, while approval workflows introduce controlled transitions and role-based validations. Choosing the right pattern depends on business needs: simple flows for routine, low-risk operations, and approval flows for processes requiring oversight.

Workflows in Odoo 19 replace legacy engines with modular, flexible state-based transitions. Whether it’s a simple process or a multi-stage approval flow, developers can define states, methods, and access rules to build clear and maintainable workflows. Understanding how to blend these components helps streamline business processes while keeping control and compliance intact.

To read more about How to Set Up Approval Workflows in Odoo 19 Purchase Orders, refer to our blog How to Set Up Approval Workflows in Odoo 19 Purchase Orders.


Frequently Asked Questions

What is the difference between simple and approval workflows?

Simple workflows move records between states directly, while approval workflows require authorization before changing certain states.

Which field is commonly used to define workflow states?

Selection field is commonly used to define the different states in a workflow.

When should approval workflows be used?

Approval workflows are used when a process requires validation, control, or compliance, such as bill or purchase approvals.

If you need any assistance in odoo, we are online, please chat with us.



0
Comments



Leave a comment



whatsapp_icon
location

Calicut

Cybrosys Technologies Pvt. Ltd.
Neospace, KINFRA Techno Park
Kakkanchery, Calicut
Kerala, India - 673635

location

Kochi

Cybrosys Technologies Pvt. Ltd.
1st Floor, Thapasya Building,
Infopark, Kakkanad,
Kochi, India - 682030.

location

Bangalore

Cybrosys Techno Solutions
The Estate, 8th Floor,
Dickenson Road,
Bangalore, India - 560042

Send Us A Message