[Erp5-report] r32764 luke - in /erp5/trunk/products/ERP5/bootstrap/erp5_core: SkinTemplateI...
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu Feb 18 13:15:29 CET 2010
Author: luke
Date: Thu Feb 18 13:15:27 2010
New Revision: 32764
URL: http://svn.erp5.org?rev=32764&view=rev
Log:
- test each category object before expiration
In 32760 isTransitionPossible was used to test if portal type is associated
with a workflow providing such transition. It was wrong oversimplification.
It is required to test each object if expiration can be made, so it will solve
both issues - object is not related with workflow providing such action and
object is in state, from which expiration is not possible.
Modified:
erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/CategoryTool_importCategoryFile.xml
erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision
Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/CategoryTool_importCategoryFile.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/CategoryTool_importCategoryFile.xml?rev=32764&r1=32763&r2=32764&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/CategoryTool_importCategoryFile.xml [utf8] (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/CategoryTool_importCategoryFile.xml [utf8] Thu Feb 18 13:15:27 2010
@@ -274,7 +274,6 @@
category_to_delete_list.append(category.getRelativeUrl())\n
\n
if not simulation_mode:\n
- \n
# Delete unused categories\n
if existing_category_list == \'delete\':\n
for category in category_to_delete_list:\n
@@ -290,15 +289,13 @@
if category is not None:\n
category.edit(**{\'expiration_date\':expiration_date})\n
else:\n
+ isTransitionPossible = context.getPortalObject().portal_workflow \\\n
+ .isTransitionPossible\n
for category in category_to_delete_list:\n
- expiration_possible = context.getPortalObject().portal_workflow \\\n
- .isTransitionPossible(category, \'expire\')\n
- break\n
- if expiration_possible:\n
- for category in category_to_delete_list:\n
- category = context.portal_categories.resolveCategory(category)\n
- if category is not None:\n
- category.expire()\n
+ category = context.portal_categories.resolveCategory(category)\n
+ if category is not None \\\n
+ and isTransitionPossible(category, \'expire\'):\n
+ category.expire()\n
\n
\n
\n
@@ -433,7 +430,7 @@
<string>category_to_delete_list</string>
<string>base_category_id</string>
<string>parent</string>
- <string>expiration_possible</string>
+ <string>isTransitionPossible</string>
</tuple>
</value>
</item>
Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision?rev=32764&r1=32763&r2=32764&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision [utf8] (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision [utf8] Thu Feb 18 13:15:27 2010
@@ -1,1 +1,1 @@
-1477
+1478
More information about the Erp5-report
mailing list