From c08d76e21183a7de9091d63600099954e14aa9ad Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Fri, 23 Jun 2023 12:33:22 +0100 Subject: [PATCH] [FIX] account_journal_general_sequence: unique entry number per journal The sequence is applied per journal. Thus, we can't require one number per company, but per journal. @moduon MT-3082 --- .../i18n/account_journal_general_sequence.pot | 2 +- account_journal_general_sequence/i18n/es.po | 4 ++-- account_journal_general_sequence/models/account_move.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/account_journal_general_sequence/i18n/account_journal_general_sequence.pot b/account_journal_general_sequence/i18n/account_journal_general_sequence.pot index ad755872..ee19db6d 100644 --- a/account_journal_general_sequence/i18n/account_journal_general_sequence.pot +++ b/account_journal_general_sequence/i18n/account_journal_general_sequence.pot @@ -73,7 +73,7 @@ msgstr "" #. module: account_journal_general_sequence #: model:ir.model.constraint,message:account_journal_general_sequence.constraint_account_move_entry_number_unique -msgid "Entry number must be unique per company." +msgid "Entry number must be unique per journal." msgstr "" #. module: account_journal_general_sequence diff --git a/account_journal_general_sequence/i18n/es.po b/account_journal_general_sequence/i18n/es.po index 0870890a..be836937 100644 --- a/account_journal_general_sequence/i18n/es.po +++ b/account_journal_general_sequence/i18n/es.po @@ -79,8 +79,8 @@ msgstr "Número de asiento" #. module: account_journal_general_sequence #: model:ir.model.constraint,message:account_journal_general_sequence.constraint_account_move_entry_number_unique -msgid "Entry number must be unique per company." -msgstr "El número de asiento debe ser único por compañía." +msgid "Entry number must be unique per journal." +msgstr "El número de asiento debe ser único por diario." #. module: account_journal_general_sequence #: model:ir.model.fields,field_description:account_journal_general_sequence.field_account_journal__id diff --git a/account_journal_general_sequence/models/account_move.py b/account_journal_general_sequence/models/account_move.py index c02e517d..28179d39 100644 --- a/account_journal_general_sequence/models/account_move.py +++ b/account_journal_general_sequence/models/account_move.py @@ -15,8 +15,8 @@ class AccountMove(models.Model): _sql_constraints = [ ( "entry_number_unique", - "UNIQUE(entry_number, company_id)", - "Entry number must be unique per company.", + "UNIQUE(entry_number, journal_id)", + "Entry number must be unique per journal.", ), ]