From 9f65df770a1167f8ff209ac5c8d786b7ccf201e8 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 : 7.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 7f7e2b28e4..5cd0db19b0 100644 --- a/trytond/trytond/model/modelsql.py +++ b/trytond/trytond/model/modelsql.py @@ -147,7 +147,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