From f0f9406110b124e00959881c3d0523c379a8c780 Mon Sep 17 00:00:00 2001
From: Sebastien Robin <seb@nexedi.com>
Date: Wed, 8 Jun 2005 14:46:58 +0000
Subject: [PATCH] use range_min and range_max instead of min and max

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3220 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/Tool/DomainTool.py | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/product/ERP5/Tool/DomainTool.py b/product/ERP5/Tool/DomainTool.py
index f41c45ca06..209b26e5eb 100755
--- a/product/ERP5/Tool/DomainTool.py
+++ b/product/ERP5/Tool/DomainTool.py
@@ -86,10 +86,10 @@ class DomainTool(BaseTool):
         if column in checked_column_list:
           continue
         range_property = 0
-        if column.endswith('_min') or column.endswith('_max'):
+        if column.endswith('_range_min') or column.endswith('_range_max'):
           range_property = 1
-          property = column[-len('_min')]
-        if '%s_min' % column in column_list:
+          property = column[-len('_range_min')]
+        if '%s_range_min' % column in column_list:
           range_property = 1
           property = column
         if range_property:
@@ -97,17 +97,21 @@ class DomainTool(BaseTool):
           base_name = 'predicate.%s' % property
           value = context.getProperty(property)
           if value is None:
-            expression_list.append('%s is NULL AND %s_min is NULL AND %s_max is NULL' % ((base_name,)*3))
+            expression_list.append('%s is NULL AND %s_range_min is NULL AND %s_range_max is NULL' 
+                                   % ((base_name,)*3))
           else:
-            expression =     '%s is NULL AND %s_min is NULL AND %s_max is NULL ' % ((base_name,)*3) 
+            expression = '%s is NULL AND %s_range_min is NULL AND %s_range_max is NULL ' % ((base_name,)*3) 
             expression += 'OR %s = %s ' % (base_name,value)
-            expression += 'OR %s_min <= %s AND %s_max is NULL ' % (base_name,value,base_name)
-            expression += 'OR %s_min is NULL AND %s_max > %s ' % (base_name,base_name,value)
-            expression += 'OR %s_min <= %s AND %s_max > %s ' % (base_name,value,base_name,value)
+            expression += 'OR %s_range_min <= %s AND %s_range_max is NULL ' \
+                           % (base_name,value,base_name)
+            expression += 'OR %s_range_min is NULL AND %s_range_max > %s ' \
+                           % (base_name,base_name,value)
+            expression += 'OR %s_range_min <= %s AND %s_range_max > %s ' \
+                           % (base_name,value,base_name,value)
             expression_list.append(expression)
           checked_column_list.append('%s' % property)
-          checked_column_list.append('%s_min' % property)
-          checked_column_list.append('%s_max' % property)
+          checked_column_list.append('%s_range_min' % property)
+          checked_column_list.append('%s_range_max' % property)
       # Add predicate.uid for automatic join
       sql_kw['predicate.uid'] = '!=0'
       where_expression = ' OR '.join(expression_list)
-- 
2.30.9