Skip to Content
Menu
This question has been flagged
1 Reply
736 Views

Hi all

I'm using Odoo 18 Online (SaaS) and I've set a custom invoice sequence in the Customer Invoices journal like this:

  • Prefix: INV
  • Next Number: 4001
  • Suffix: /25 ← This is meant to represent the year 2025

So invoice numbers look like: INV-4001/25, INV-4002/25, etc.

The problem:

Every time I create a new invoice, the suffix doesn’t stay as /25. Instead, it self-increments on its own like this:

  • INV-4001/25
  • INV-4002/26
  • INV-4003/27
  • so on...

I manually entered /25 as the suffix — I don't want it to increase like part of the number.

What I need:

  • A way to lock the suffix to stay as /25
  • OR a proper method to dynamically use the year (e.g., auto-update to /2025, /2026etc.) if that's even supported on Online/SaaS

Appreciate any insights, thanks!


Avatar
Discard
Author Best Answer

I fixed this issue by creating a custom sequence and attaching it using server automation (Automated Action).

for record in records:

    if not record.name or record.name == '/':

        record['name'] = env['ir.sequence'].next_by_code('custom.invoice.sequence')



Avatar
Discard
Related Posts Replies Views Activity
0
Aug 25
9
0
Aug 25
2
1
Aug 25
129
1
Aug 25
152
0
Aug 25
53