[Erp5-report] r29583 - in /erp5/trunk/bt5/erp5_ui_test: SkinTemplateItem/portal_skins/erp5_...

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Oct 13 10:45:01 CEST 2009


Author: jerome
Date: Tue Oct 13 10:45:01 2009
New Revision: 29583

URL: http://svn.erp5.org?rev=29583&view=rev
Log:
Fix for new portal types:
* specify the action priority in PortalType_addAction, because new added action is no longer the last one
* Don't call listActions in PortalType_deleteAction, this method is now private

Modified:
    erp5/trunk/bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/PortalType_addAction.xml
    erp5/trunk/bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/PortalType_deleteAction.xml
    erp5/trunk/bt5/erp5_ui_test/bt/revision

Modified: erp5/trunk/bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/PortalType_addAction.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/PortalType_addAction.xml?rev=29583&r1=29582&r2=29583&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/PortalType_addAction.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/PortalType_addAction.xml [utf8] Tue Oct 13 10:45:01 2009
@@ -55,7 +55,7 @@
             <key> <string>_body</string> </key>
             <value> <string>"""Add or replace an action on a type informations from types tool.\n
 """\n
-assert context.meta_type == \'ERP5 Type Information\'\n
+assert context.meta_type in (\'ERP5 Type Information\', \'ERP5 Base Type\'), context.meta_type\n
 \n
 context.PortalType_deleteAction(id=id)\n
 \n
@@ -66,6 +66,7 @@
                  , permission = permission\n
                  , category   = category\n
                  , icon       = icon\n
+                 , priority   = 10.0\n
                  )\n
 \n
 return \'Set Successfully.\'\n

Modified: erp5/trunk/bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/PortalType_deleteAction.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/PortalType_deleteAction.xml?rev=29583&r1=29582&r2=29583&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/PortalType_deleteAction.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/PortalType_deleteAction.xml [utf8] Tue Oct 13 10:45:01 2009
@@ -55,15 +55,23 @@
             <key> <string>_body</string> </key>
             <value> <string>"""Delete an action on a type informations from types tool.\n
 """\n
-assert context.meta_type == \'ERP5 Type Information\'\n
+assert context.meta_type in (\'ERP5 Type Information\', \'ERP5 Base Type\'), context.meta_type\n
 \n
-existing_actions_indexs = []\n
-for idx, ai in enumerate(context.listActions()):\n
-  if ai.getId() == id:\n
-    existing_actions_indexs.append(idx)\n
+if context.meta_type == \'ERP5 Type Information\':\n
+  existing_actions_indexs = []\n
+  for idx, ai in enumerate(context.listActions()):\n
+    if ai.getId() == id:\n
+      existing_actions_indexs.append(idx)\n
 \n
-if existing_actions_indexs:\n
-  context.deleteActions(existing_actions_indexs)\n
+  if existing_actions_indexs:\n
+    context.deleteActions(existing_actions_indexs)\n
+else:\n
+  existing_actions_ids = []\n
+  for action in context.objectValues(spec=\'ERP5 Action Information\'):\n
+    if action.getReference() == id:\n
+      existing_actions_ids.append(action.getId())\n
+  if existing_actions_ids:\n
+    context.manage_delObjects(existing_actions_ids)\n
 \n
 return \'Set Successfully.\'\n
 </string> </value>
@@ -111,6 +119,8 @@
                             <string>enumerate</string>
                             <string>idx</string>
                             <string>ai</string>
+                            <string>existing_actions_ids</string>
+                            <string>action</string>
                           </tuple>
                         </value>
                     </item>

Modified: erp5/trunk/bt5/erp5_ui_test/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_ui_test/bt/revision?rev=29583&r1=29582&r2=29583&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_ui_test/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_ui_test/bt/revision [utf8] Tue Oct 13 10:45:01 2009
@@ -1,1 +1,1 @@
-498
+499




More information about the Erp5-report mailing list