details:   https://code.tryton.org/tryton/commit/8a15f909138d
branch:    6.0
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
        (grafted from 7e50d52dc65227f494c6ad965917364fc08f0c5e)
diffstat:

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

diffs (12 lines):

diff -r bb4d22c544f7 -r 8a15f909138d trytond/trytond/model/modelsql.py
--- a/trytond/trytond/model/modelsql.py Tue Dec 23 12:09:31 2025 +0100
+++ b/trytond/trytond/model/modelsql.py Wed Dec 24 11:38:45 2025 +0100
@@ -144,7 +144,7 @@
             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

Reply via email to