From 2e1d79d05072e88686f37a63935c2d33c63b7668 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. --- 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 47116b3df5..ea0e883c5d 100644 --- a/trytond/trytond/model/modelsql.py +++ b/trytond/trytond/model/modelsql.py @@ -2187,7 +2187,8 @@ class ModelSQL(ModelStorage): continue table = sql.table if isinstance(sql, (Unique, Exclude)): - cls.lock() + if backend.name != 'sqlite': + cls.lock() if not database.has_range(): columns = [] for col in sql.columns: