[Erp5-report] r15606 - /erp5/trunk/products/CMFCategory/CategoryTool.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Aug 10 17:46:16 CEST 2007


Author: jerome
Date: Fri Aug 10 17:46:16 2007
New Revision: 15606

URL: http://svn.erp5.org?rev=15606&view=rev
Log:
If we have a fallback category, it's not a problem if the acquisition object
doesn't have the original base category.
The use case is that for destination_region to work on a movement (the
movement should acquire the region from the destination node), the node itself
doesn't have to define destination_region category.


Modified:
    erp5/trunk/products/CMFCategory/CategoryTool.py

Modified: erp5/trunk/products/CMFCategory/CategoryTool.py
URL: http://svn.erp5.org/erp5/trunk/products/CMFCategory/CategoryTool.py?rev=15606&r1=15605&r2=15606&view=diff
==============================================================================
--- erp5/trunk/products/CMFCategory/CategoryTool.py (original)
+++ erp5/trunk/products/CMFCategory/CategoryTool.py Fri Aug 10 17:46:16 2007
@@ -838,7 +838,6 @@
       #LOG("Get Acquired Category acquired_object_dict: ",0,str(acquired_object_dict))
       # XXX We must use filters in the future
       # where_expression = self._buildQuery(spec, filter, kw)
-
       portal_type = kw.get('portal_type', ())
       if spec is (): spec = portal_type # This is bad XXX - JPS - spec is for meta_type, not for portal_type - be consistent !
 
@@ -964,10 +963,11 @@
               #  continue
               #acquired_object_dict[my_acquisition_object_path] = 1
               #if hasattr(my_acquisition_object, '_categories'): # This would be a bug since we have category acquisition
-                # We should only consider objects which define that category
                 #LOG('my_acquisition_object',0, str(getattr(my_acquisition_object, '_categories', ())))
                 #LOG('my_acquisition_object',0, str(base_category))
-                if base_category in getattr(my_acquisition_object, '_categories', ()):
+                
+                # We should only consider objects which define that category
+                if base_category in getattr(my_acquisition_object, '_categories', ()) or base_category_value.getFallbackBaseCategoryList():
                   if (not acquired_portal_type) or my_acquisition_object.portal_type in acquired_portal_type:
                     #LOG("Recursive call ",0,str((spec, my_acquisition_object.portal_type)))
                     new_result = self.getSingleCategoryAcquiredMembershipList(my_acquisition_object,




More information about the Erp5-report mailing list