When you’re managing multiple projects in Odoo, things can get messy—fast. One of the simplest ways to keep order is by giving each project a unique, structured ID or code using a sequence. But here’s the magic part: you don’t have to assign these manually.
Thanks to Automated Actions, you can generate custom project sequences in Odoo without writing a single line of code.
In this guide, we’ll walk through how to set up a custom sequence for your projects that automatically triggers whenever a new one is created. No manual input. No developer needed. Just smart automation.
Why Use Sequences for Projects?
A custom sequence (like PRJ0001, PRJ0002, etc.) can help:
- Easily reference projects in reports or emails.
- Avoid duplicate or confusing names.
- Create a consistent format across departments.
- Improve search and filtering.
What You’ll Build
By the end of this tutorial, you’ll have:
✅ A sequence format like PRJ0001 for each new project
✅ An Automated Action that auto-applies the sequence on project creation
✅ A setup you can tweak for other models (Tasks, Leads, etc.)
Step-by-Step: Creating an Automated Action for Project Sequences
Step 1: Activate Developer Mode
- Go to the top-right menu under your name or company logo.
- Click "Settings" → Scroll down.
- Click "Activate Developer Mode."
Step 2: Create a New Sequence
- Go to Settings → Technical → Sequences & Identifiers → Sequences.
- Click Create.
- Fill in the form as follows:

Field | Value |
---|---|
Name | Project Sequence |
Code | project.sequence |
Prefix | PRJ |
Padding | 4 |
Next Number | 1 |
💡 This setup will generate codes like PRJ0001, PRJ0002, etc.

Step 3: Add a Custom Field (If Needed)
If your Project model doesn’t already have a sequence field:
- Go to Studio (top-right wrench icon on Project module).
- Drag a Char field onto the form.
- Label it Project Code or Project ID.
- Set its technical name to sequence.
Step 4: Create an Automated Action
- Go to Settings → Technical → Automated Actions.
- Click Create.
Now configure the action:
Field | Value |
---|---|
Name | Auto Project Sequence |
Model | Project |
Trigger | On Creation |
Action To Do | Execute Python Code |
if not record.x_studio_sequence:
record.write({
'x_studio_sequence' : env['ir.sequence'].next_by_code('project.sequence')
})
Step 5: Test It!
Now create a new Project:
- Go to Project → Create.
- Enter a name and save.
Boom. 🎉 You’ll see a unique project code (like PRJ0001) automatically filled into the custom field.
With just a few clicks and one smart automated action, you've added a layer of order, automation, and professionalism to your project workflow in Odoo.
Automating sequences like this isn’t just about looking good—it’s about building scalable, error-free systems.
So next time your projects start piling up, remember: Odoo automation has your back.