details:   https://code.tryton.org/tryton/commit/7e50d52dc652
branch:    default
user:      Cédric Krier <[email protected]>
date:      Wed Dec 24 11:38:45 2025 +0100
description:
        Always surround WHERE clause with parentheses in EXCLUDE constraint

        Closes #14449
diffstat:

 trytond/trytond/model/modelsql.py |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 74b709c7572c -r 7e50d52dc652 trytond/trytond/model/modelsql.py
--- a/trytond/trytond/model/modelsql.py Mon Dec 29 20:47:40 2025 +0100
+++ b/trytond/trytond/model/modelsql.py Wed Dec 24 11:38:45 2025 +0100
@@ -148,7 +148,7 @@
             for column, operator in self.excludes)
         where = ''
         if self.where:
-            where = ' WHERE ' + str(self.where)
+            where = ' WHERE (' + str(self.where) + ')'
         if using:
             using = 'USING ' + using
         return 'EXCLUDE %s (%s)' % (using, exclude) + where

Reply via email to