Przejdź do zawartości
Odoo Menu
  • Zaloguj się
  • Wypróbuj za darmo
  • Aplikacje
    Finanse
    • Księgowość
    • Fakturowanie
    • Wydatki
    • Arkusz kalkulacyjny (BI)
    • Dokumenty
    • Podpisy
    Sprzedaż
    • CRM
    • Sprzedaż
    • PoS Sklep
    • PoS Restauracja
    • Subskrypcje
    • Wypożyczalnia
    Strony Internetowe
    • Kreator Stron Internetowych
    • eCommerce
    • Blog
    • Forum
    • Czat na Żywo
    • eLearning
    Łańcuch dostaw
    • Magazyn
    • Produkcja
    • PLM
    • Zakupy
    • Konserwacja
    • Jakość
    Zasoby Ludzkie
    • Pracownicy
    • Rekrutacja
    • Urlopy
    • Ocena pracy
    • Polecenia Pracownicze
    • Flota
    Marketing
    • Marketing Społecznościowy
    • E-mail Marketing
    • SMS Marketing
    • Wydarzenia
    • Automatyzacja Marketingu
    • Ankiety
    Usługi
    • Projekt
    • Ewidencja czasu pracy
    • Usługi Terenowe
    • Helpdesk
    • Planowanie
    • Spotkania
    Produktywność
    • Dyskusje
    • Sztuczna inteligencja
    • IoT
    • VoIP
    • Wiedza
    • WhatsApp
    Aplikacje trzecich stron Studio Odoo Odoo Cloud Platform
  • Branże
    Sprzedaż detaliczna
    • Księgarnia
    • Sklep odzieżowy
    • Sklep meblowy
    • Sklep spożywczy
    • Sklep z narzędziami
    • Sklep z zabawkami
    Żywienie i hotelarstwo
    • Bar i Pub
    • Restauracja
    • Fast Food
    • Pensjonat
    • Dystrybutor napojów
    • Hotel
    Agencja nieruchomości
    • Agencja nieruchomości
    • Biuro architektoniczne
    • Budowa
    • Zarządzanie nieruchomościami
    • Ogrodnictwo
    • Stowarzyszenie właścicieli nieruchomości
    Doradztwo
    • Biuro księgowe
    • Partner Odoo
    • Agencja marketingowa
    • Kancelaria prawna
    • Agencja rekrutacyjna
    • Audyt i certyfikacja
    Produkcja
    • Tekstylia
    • Metal
    • Meble
    • Jedzenie
    • Browar
    • Prezenty firmowe
    Zdrowie & Fitness
    • Klub sportowy
    • Salon optyczny
    • Centrum fitness
    • Praktycy Wellness
    • Apteka
    • Salon fryzjerski
    Transakcje
    • Złota rączka
    • Wsparcie Sprzętu IT
    • Systemy energii słonecznej
    • Szewc
    • Firma sprzątająca
    • Usługi HVAC
    Inne
    • Organizacja non-profit
    • Agencja Środowiskowa
    • Wynajem billboardów
    • Fotografia
    • Leasing rowerów
    • Sprzedawca oprogramowania
    Przeglądaj wszystkie branże
  • Community
    Ucz się
    • Samouczki
    • Dokumentacja
    • Certyfikacje
    • Szkolenie
    • Blog
    • Podcast
    Pomóż w nauce innym
    • Program Edukacyjny
    • Scale Up! Gra biznesowa
    • Odwiedź Odoo
    Skorzystaj z oprogramowania
    • Pobierz
    • Porównaj edycje
    • Wydania
    Współpracuj
    • Github
    • Forum
    • Wydarzenia
    • Tłumaczenia
    • Zostań partnerem
    • Usługi dla partnerów
    • Zarejestruj swoją firmę rachunkową
    Skorzystaj z usług
    • Znajdź partnera
    • Znajdź księgowego
    • Spotkaj się z doradcą
    • Usługi wdrożenia
    • Opinie klientów
    • Wsparcie
    • Aktualizacje
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Zaplanuj demo
  • Cennik
  • Pomoc
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Pomoc

How to automatically assign sequence numbers to records in a Studio-created model ✅ SOLVED

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
studio
1018 Widoki
Awatar
Diego Cerrilla (dice)

When creating a custom model with Odoo Studio, you may need each new record to receive its own automatic reference number, similar to a quotation number, purchase order number, ticket number, or manufacturing order number.

For example, a custom model called Request may need records numbered automatically as follows:

  • REQ-000001

  • REQ-000002

  • REQ-000003

This can be configured directly with Odoo Studio, without requiring Python code or a custom module.

Use Case

A Studio-created model has a Name field that identifies each record. By default, users may need to enter this value manually.

Instead, the objective is to:

  • Automatically assign the next sequential number when a record is created.

  • Prevent regular users from manually changing the generated reference.

  • Avoid duplicate numbers caused by manual data entry.

Step 1: Configure the Name Field

Open the custom model and enter Studio.

Select the field that will store the record reference, normally the model's Name field.

Configure the field as follows:

  • Change the label if needed, for example: Reference, Request Number, or Record Number.

  • Enable Readonly so users cannot manually modify the assigned number from the form view.

  • If the field is required, set a temporary Default Value, such as /.

The temporary value is useful because the record must first be saved before the automated action can assign the actual sequence number.


Step 2: Create the Sequence

From the automated action configuration, a new sequence can be created directly when selecting the sequence to apply. Alternatively, with developer mode enabled, sequences can be managed from:

Settings → Technical → Sequences & Identifiers → Sequences

Create a sequence and configure the desired numbering format.

Example:

  • Name: Request Sequence

  • Prefix: REQ-

  • Sequence Size: 6

  • Step: 1

  • Next Number: 1

With this configuration, the generated values will be:

  • REQ-000001

  • REQ-000002

  • REQ-000003

The prefix and suffix can also use dynamic placeholders, such as the year or month, when a format such as REQ-2026-000001 is needed.

Step 3: Create the Automation Rule

Open the Studio-created model, then go to:

Studio → Automations → New

Configure the automation rule as follows:

  • Name: Assign Automatic Reference Number

  • Model: Your Studio-created model

  • Trigger: Custom → On create

The On create trigger ensures that the action is executed when a new record is saved for the first time.

No additional conditions are needed unless the sequence should only apply to specific records.

Step 4: Add the Sequence Action

Under Actions To Do, add a new action and configure it as follows:

  • Action Type: Update Record

  • Option: Sequence

  • Field to Update: Select the field that stores the record reference, usually Name.

  • Sequence: Select the sequence created in the previous step.

Save the automation rule.

Result

When a user creates and saves a new record in the Studio-created model:

  1. The record is initially created with the temporary value, such as /, if that default value was needed.

  2. The automation rule runs immediately after creation.

  3. Odoo retrieves the next number from the selected sequence.

  4. The Name or reference field is updated automatically.

  5. Since the field is read-only, regular users cannot manually change the number from the form view.

For example:

New RecordAssigned Reference
First recordREQ-000001
Second recordREQ-000002
Third recordREQ-000003

Important Note About Duplicate Prevention

Using a sequence prevents duplicate numbering during the normal automatic record creation process. Making the field read-only also prevents regular users from manually overwriting the reference through the standard form view.

However, Readonly is a user-interface restriction, not a database-level uniqueness constraint. A value could still potentially be modified through imports, integrations, API calls, or technical actions.

Therefore:

  • For standard Studio use cases, the combination of Sequence + On create automation + Readonly field is usually sufficient.

  • If the reference must be technically guaranteed as unique under all circumstances, custom development is required to add a server-side uniqueness constraint to the field.

1
Awatar
Odrzuć
Podoba Ci się ta dyskusja? Dołącz do niej!

Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!

Zarejestruj się
Powiązane posty Odpowiedzi Widoki Czynność
Custom popup Rozwiązane
studio
Awatar
Awatar
2
mar 26
1575
Menu's with different default filter Rozwiązane
studio
Awatar
Awatar
1
gru 25
3770
How to add or reorder columns in Studio Rozwiązane
studio
Awatar
Awatar
1
gru 25
1974
Studio V18 Domain does not have current field
studio
Awatar
Awatar
1
gru 25
1685
debit and credit in currency
studio
Awatar
Awatar
1
lis 25
3488
Społeczność
  • Samouczki
  • Dokumentacja
  • Forum
Open Source
  • Pobierz
  • Github
  • Runbot
  • Tłumaczenia
Usługi
  • Hosting Odoo.sh
  • Wsparcie
  • Aktualizacja
  • Indywidualne rozwiązania
  • Edukacja
  • Znajdź księgowego
  • Znajdź partnera
  • Zostań partnerem
O nas
  • Nasza firma
  • Zasoby marki
  • Skontaktuj się z nami
  • Oferty pracy
  • Wydarzenia
  • Podcast
  • Blog
  • Klienci
  • Informacje prawne • Prywatność
  • Bezpieczeństwo Odoo
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk Slovenščina Español (América Latina) Español Svenska ภาษาไทย Türkçe українська Tiếng Việt

Odoo to pakiet aplikacji biznesowych typu open source, które zaspokoją wszystkie potrzeby Twojej firmy: CRM, eCommerce, księgowość, inwentaryzacja, punkt sprzedaży, zarządzanie projektami itp.

Unikalną wartością Odoo jest to, że jest jednocześnie bardzo łatwe w użyciu i w pełni zintegrowane.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now