From adfde92e1a7317d855d26789c4f6d6df628e1ce6 Mon Sep 17 00:00:00 2001
From: Sebastien Robin <seb@nexedi.com>
Date: Mon, 13 Feb 2012 18:22:31 +0100
Subject: [PATCH] this dialog assume that the simulation state in in catalog
 table

This fix only make the code consistent with the above assumption.
We should later allow getting state in another table than catalog,
but then the design of this script will need to be reviewed in
order to not do many useless sql queries
---
 .../Extensions/Folder_getWorkflowActionDocumentList.py        | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/product/ERP5Form/Extensions/Folder_getWorkflowActionDocumentList.py b/product/ERP5Form/Extensions/Folder_getWorkflowActionDocumentList.py
index 27eda2877b..4c02d57e49 100644
--- a/product/ERP5Form/Extensions/Folder_getWorkflowActionDocumentList.py
+++ b/product/ERP5Form/Extensions/Folder_getWorkflowActionDocumentList.py
@@ -58,9 +58,9 @@ def getDocumentGroupByWorkflowStateList(self, form_id='', **kw):
   listbox = getattr(form, 'listbox', None)
 
   # guess all column name from catalog schema
-  possible_state_list = [column_name for column_name in
+  possible_state_list = [column_name.split('.')[1] for column_name in
        self.getPortalObject().portal_catalog.getSQLCatalog().getColumnMap() if
-       column_name.endswith('state') and '.' not in column_name]
+       column_name.startswith('catalog.') and column_name.endswith('state')]
 
   # If there are checked uids, only use checked uids.
   selection_uid_list = selection_tool.getSelectionCheckedUidsFor(selection_name)
-- 
2.30.9