mirror of
https://github.com/NaN-tic/trytond-account_invoice_multisequence-old.git
synced 2023-12-14 03:03:01 +01:00
Fix sql constraints
This commit is contained in:
parent
a284af91e7
commit
88622bc98c
|
@ -1,7 +1,7 @@
|
|||
# This file is part of the account_invoice_multisequence module for Tryton.
|
||||
# The COPYRIGHT file at the top level of this repository contains the full
|
||||
# copyright notices and license terms.
|
||||
from trytond.model import ModelView, ModelSQL, fields
|
||||
from trytond.model import ModelView, ModelSQL, fields, Unique
|
||||
from trytond.pool import Pool, PoolMeta
|
||||
from trytond.pyson import Eval, If, In, Not
|
||||
from trytond.transaction import Transaction
|
||||
|
@ -57,8 +57,9 @@ class AccountJournalInvoiceSequence(ModelSQL, ModelView):
|
|||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(AccountJournalInvoiceSequence, cls).__setup__()
|
||||
t = cls.__table__()
|
||||
cls._sql_constraints += [
|
||||
('journal_fiscalyear_uniq', 'UNIQUE(journal, fiscalyear)',
|
||||
('journal_fiscalyear_uniq', Unique(t, t.journal, t.fiscalyear),
|
||||
'Fiscal Year - Journal pair must be unique.'),
|
||||
]
|
||||
|
||||
|
|
Loading…
Reference in a new issue