From e605d5f0d379a25859d5c4691e1e1382c8c52b9b Mon Sep 17 00:00:00 2001 From: Frederik Jaeckel Date: Thu, 8 Jun 2023 17:08:47 +0200 Subject: [PATCH] line, type: fix index --- line.py | 2 +- types.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/line.py b/line.py index 18cbb3e..6a202f5 100644 --- a/line.py +++ b/line.py @@ -245,7 +245,7 @@ class Line(SecondCurrencyMixin, MemCacheIndexMx, Workflow, ModelSQL, ModelView): (t.state, Index.Equality())), Index( t, - (t.reference, Index.Range())), + (t.reference, Index.Equality())), }) cls._sql_constraints.extend([ ('state_val2', diff --git a/types.py b/types.py index 1217adf..42bb54d 100644 --- a/types.py +++ b/types.py @@ -3,7 +3,7 @@ # 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, Unique +from trytond.model import ModelView, ModelSQL, fields, Unique, Index from trytond.transaction import Transaction from trytond.i18n import gettext @@ -30,6 +30,11 @@ class Type(ModelSQL, ModelView): cls._sql_constraints.extend([ ('code_uniq', Unique(t, t.short), 'cashbook.msg_type_short_unique'), ]) + cls._sql_indexes.update({ + Index( + t, + (t.feature, Index.Equality())), + }) @classmethod def default_feature(cls):