From 9e8a02565d27319fe32773600538dfdeb060eeb7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C5=81ukasz=20Nowak?= <luke@nexedi.com>
Date: Mon, 4 Apr 2011 08:47:55 +0000
Subject: [PATCH]  - no state at all shall be taken while looking for packing
 list for software    instance, as the newest packing list state selects its
 state and conditions

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@45036 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/Vifib/Tool/SlapTool.py | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/product/Vifib/Tool/SlapTool.py b/product/Vifib/Tool/SlapTool.py
index e4740d6d51..68b33c3d8a 100644
--- a/product/Vifib/Tool/SlapTool.py
+++ b/product/Vifib/Tool/SlapTool.py
@@ -415,7 +415,6 @@ class SlapTool(BaseTool):
 
       elif movement.getResource() == \
               portal_preferences.getPreferredInstanceCleanupResource():
-
         if movement.getSimulationState() in ('confirmed', 'started', 'stopped'):
           slap_partition._need_modification = 1
 
@@ -721,25 +720,14 @@ class SlapTool(BaseTool):
       service = portal.restrictedTraverse(service_relative_url)
       service_uid_list.append(service.getUid())
 
-    # Get associated software release
-    state_list = []
-    state_list.extend(portal.getPortalCurrentInventoryStateList())
-    state_list.extend(portal.getPortalReservedInventoryStateList())
-    state_list.extend(portal.getPortalTransitInventoryStateList())
-
     # Use getTrackingList
-    catalog_result = portal.portal_catalog(
+    return portal.portal_catalog.getResultValue(
       portal_type='Sale Packing List Line',
-      simulation_state=state_list,
       aggregate_relative_url=computer_partition_document.getRelativeUrl(),
       default_resource_uid=service_uid_list,
       sort_on=(('movement.start_date', 'DESC'),),
       limit=1,
     )
-    if len(catalog_result):
-      return catalog_result[0].getObject()
-    else:
-      return None
 
   def _reportComputerUsage(self, computer, usage):
     """Stores usage report of a computer."""
-- 
2.30.9