Automatic Numbering
Juni 02, 2024 • •
Automatic numbering is an essential feature in Odoo that simplifies data management by providing unique identifiers for each document, such as invoices, purchase orders, and shipments. To create automatic numbering in Odoo, you can utilize the Sequences feature. Here are the steps to create automatic numbering:
Creating a New Sequence:
- Open the Settings menu.
 - Navigate to Technical > Sequences & Identifiers > Sequences.
 - Click the Create button to create a new sequence.
 - Set the numbering pattern as needed, for example:
- Prefix: 
INV/ - Suffix: 
/ - Number Increment: 
1 
 - Prefix: 
 - Click Save to save the new sequence.
 
- Open the appropriate document model, such as 
account.movefor invoices. - Edit the form model and set the sequence in the 
sequence_idfield. - Save the changes.
 
Dengan Automation Rules:
- Open Automation Rules dan Choose Model e.g : 
account.movefor invoices. - Choose for the Triger 
On Creation. - Add 
ACTIONdan inputExecute Code 
Kode Pyhton
record.update({'x_name':env['ir.sequence'].next_by_code('nama_sequence')})
By following these steps, Odoo will automatically generate invoice numbers based on the defined sequence every time a new invoice is created. This feature not only enhances efficiency but also reduces manual errors in document numbering, ensuring each document has a unique and easily trackable number.