From 5432222efb67a6eadd692f2fb8b91bda2e937449 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 27 Apr 2025 17:20:45 +0200 Subject: [PATCH] Do not lock table on SQLite when checking unsupported constraint It is not needed as SQLite does not have an explicit lock mechanism but such call restart the transaction anyway. (grafted from 4cc5987a3b800121007968cebb5976a5cac2384b) --HG-- branch : 7.0 --- trytond/trytond/model/modelsql.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/trytond/trytond/model/modelsql.py b/trytond/trytond/model/modelsql.py index c104f5aef9..098f278b15 100644 --- a/trytond/trytond/model/modelsql.py +++ b/trytond/trytond/model/modelsql.py @@ -2135,7 +2135,8 @@ class ModelSQL(ModelStorage): continue table = sql.table if isinstance(sql, (Unique, Exclude)): - lock(connection, cls._table) + if backend.name != 'sqlite': + lock(connection, cls._table) columns = list(sql.columns) columns.insert(0, table.id) in_max = transaction.database.IN_MAX // (len(columns) + 1)