From c7854362b72dc2fc107c14f74b9ef24615cac8a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 24 Dec 2025 11:38:45 +0100 Subject: [PATCH] Always surround WHERE clause with parentheses in EXCLUDE constraint Closes #14449 (grafted from 7e50d52dc65227f494c6ad965917364fc08f0c5e) --HG-- branch : 6.0 --- trytond/trytond/model/modelsql.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trytond/trytond/model/modelsql.py b/trytond/trytond/model/modelsql.py index caf950ace3..487793c52d 100644 --- a/trytond/trytond/model/modelsql.py +++ b/trytond/trytond/model/modelsql.py @@ -144,7 +144,7 @@ class Exclude(Constraint): for column, operator in self.excludes) where = '' if self.where: - where = ' WHERE ' + str(self.where) + where = ' WHERE (' + str(self.where) + ')' return 'EXCLUDE (%s)' % exclude + where @property