From 4457b8914d2f19b5ba3d4e359ab298cd3185c31f Mon Sep 17 00:00:00 2001
From: Sebastien Robin <seb@nexedi.com>
Date: Wed, 12 May 2004 15:25:51 +0000
Subject: [PATCH] set nice title to predicates and fix bugs

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@874 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/Document/SupplyLine.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/product/ERP5/Document/SupplyLine.py b/product/ERP5/Document/SupplyLine.py
index 907d4a0c806..58ca40eefd6 100755
--- a/product/ERP5/Document/SupplyLine.py
+++ b/product/ERP5/Document/SupplyLine.py
@@ -36,6 +36,7 @@ from Products.ERP5Type.XMLMatrix import XMLMatrix
 from Products.ERP5.Document.DeliveryLine import DeliveryLine
 from Products.ERP5.Document.Movement import Movement
 from Products.ERP5.Document.Path import Path
+from zLOG import LOG
 
 class SupplyLine(DeliveryLine, Path):
     """
@@ -299,6 +300,7 @@ Une ligne tarifaire."""
         p = self.newContent(id = 'quantity_range_%s' % i, portal_type = 'Predicate')
         p.setCriterionPropertyList(('quantity', ))
         p.setCriterion('quantity', min=value[i], max=value[i+1])              
+        p.setTitle('%s <= quantity < %s' % (repr(value[i]),repr(value[i+1])))
       self._setVariationCategoryList(self.getVariationCategoryList())
     
     security.declareProtected( Permissions.ModifyPortalContent, '_setVariationCategoryList' )
@@ -316,9 +318,7 @@ Une ligne tarifaire."""
       kwd = {'base_id': base_id}
       new_range = self.SupplyLine_asCellRange() # This is a site dependent script
       self._setCellRange(*new_range, **kwd )
-      #LOG('setCellRange',0,str(new_range))
       cell_range_key_list = self.getCellRangeKeyList(base_id = base_id)
-      #LOG('cell_range_key_list',0,str(self.getCellRange(base_id = base_id)))
       if cell_range_key_list <> [[None, None]] :
         for k in cell_range_key_list:
           #LOG('new cell',0,str(k))
@@ -326,7 +326,7 @@ Une ligne tarifaire."""
           c.edit( domain_base_category_list = self.getVariationBaseCategoryList(),
                   mapped_value_property_list = ( 'price',),
                   predicate_operator = 'SUPERSET_OF',
-                  predicate_value = filter(lambda k_item: k_item is not None, k),
+                  predicate_category_list = filter(lambda k_item: k_item is not None, k),
                   variation_category_list = filter(lambda k_item: k_item is not None, k),
                   force_update = 1
                 ) # Make sure we do not take aquisition into account
-- 
2.30.9