From dc8b16dabaec1069bef5216bc922ebe3af47fa04 Mon Sep 17 00:00:00 2001 From: Nicolas Delaby <nicolas@nexedi.com> Date: Thu, 4 Nov 2010 16:54:24 +0000 Subject: [PATCH] rename Item_getQuantityUnit into Item_getQuantityUnitItemList keep Item_getQuantityUnit for backward compatibility git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@39921 20353a03-c40f-0410-a6d1-a30d3c3de9de --- .../erp5_item/Item_getQuantityUnit.xml | 23 +-- .../Item_getQuantityUnitItemList.xml | 136 ++++++++++++++++++ bt5/erp5_item/bt/revision | 2 +- 3 files changed, 142 insertions(+), 19 deletions(-) create mode 100644 bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/Item_getQuantityUnitItemList.xml diff --git a/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/Item_getQuantityUnit.xml b/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/Item_getQuantityUnit.xml index da5f2e9b7f..6a84f0487d 100644 --- a/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/Item_getQuantityUnit.xml +++ b/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/Item_getQuantityUnit.xml @@ -50,16 +50,9 @@ </item> <item> <key> <string>_body</string> </key> - <value> <string>resource_value = context.Item_getResourceValue()\n -movement_value = context.getAggregateRelatedValue()\n -\n -result_item_list = [(\'\', \'\')]\n -if resource_value is not None:\n - result_item_list.extend([(x.getTranslatedLogicalPath(), x.getCategoryRelativeUrl(base=0)) for x in resource_value.getQuantityUnitValueList()])\n -elif movement_value is not None:\n - result_item_list.extend([(x.getTranslatedLogicalPath(), x.getCategoryRelativeUrl(base=0)) for x in movement_value.getQuantityUnitValueList()])\n -\n -return result_item_list\n + <value> <string>from Products.ERP5Type.Log import log\n +log(\'Depracated usage of Item_getQuantityUnit, please use Item_getQuantityUnitItemList instead\')\n +return context.Item_getQuantityUnitItemList()\n </string> </value> </item> <item> @@ -96,16 +89,10 @@ return result_item_list\n <key> <string>co_varnames</string> </key> <value> <tuple> + <string>Products.ERP5Type.Log</string> + <string>log</string> <string>_getattr_</string> <string>context</string> - <string>resource_value</string> - <string>movement_value</string> - <string>result_item_list</string> - <string>None</string> - <string>append</string> - <string>$append0</string> - <string>_getiter_</string> - <string>x</string> </tuple> </value> </item> diff --git a/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/Item_getQuantityUnitItemList.xml b/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/Item_getQuantityUnitItemList.xml new file mode 100644 index 0000000000..c25d08b117 --- /dev/null +++ b/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/Item_getQuantityUnitItemList.xml @@ -0,0 +1,136 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="PythonScript" module="Products.PythonScripts.PythonScript"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>Script_magic</string> </key> + <value> <int>3</int> </value> + </item> + <item> + <key> <string>_bind_names</string> </key> + <value> + <object> + <klass> + <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/> + </klass> + <tuple/> + <state> + <dictionary> + <item> + <key> <string>_asgns</string> </key> + <value> + <dictionary> + <item> + <key> <string>name_container</string> </key> + <value> <string>container</string> </value> + </item> + <item> + <key> <string>name_context</string> </key> + <value> <string>context</string> </value> + </item> + <item> + <key> <string>name_m_self</string> </key> + <value> <string>script</string> </value> + </item> + <item> + <key> <string>name_subpath</string> </key> + <value> <string>traverse_subpath</string> </value> + </item> + </dictionary> + </value> + </item> + </dictionary> + </state> + </object> + </value> + </item> + <item> + <key> <string>_body</string> </key> + <value> <string>resource_value = context.Item_getResourceValue()\n +movement_value = context.getAggregateRelatedValue()\n +\n +result_item_list = [(\'\', \'\')]\n +if resource_value is not None:\n + result_item_list.extend([(x.getTranslatedLogicalPath(), x.getCategoryRelativeUrl(base=0)) for x in resource_value.getQuantityUnitValueList()])\n +elif movement_value is not None:\n + result_item_list.extend([(x.getTranslatedLogicalPath(), x.getCategoryRelativeUrl(base=0)) for x in movement_value.getQuantityUnitValueList()])\n +\n +return result_item_list\n +</string> </value> + </item> + <item> + <key> <string>_code</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>_params</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>errors</string> </key> + <value> + <tuple/> + </value> + </item> + <item> + <key> <string>func_code</string> </key> + <value> + <object> + <klass> + <global name="FuncCode" module="Shared.DC.Scripts.Signature"/> + </klass> + <tuple/> + <state> + <dictionary> + <item> + <key> <string>co_argcount</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>co_varnames</string> </key> + <value> + <tuple> + <string>_getattr_</string> + <string>context</string> + <string>resource_value</string> + <string>movement_value</string> + <string>result_item_list</string> + <string>None</string> + <string>append</string> + <string>$append0</string> + <string>_getiter_</string> + <string>x</string> + </tuple> + </value> + </item> + </dictionary> + </state> + </object> + </value> + </item> + <item> + <key> <string>func_defaults</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>Item_getQuantityUnitItemList</string> </value> + </item> + <item> + <key> <string>warnings</string> </key> + <value> + <tuple/> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_item/bt/revision b/bt5/erp5_item/bt/revision index 0acdeb509d..cc4f7f3feb 100644 --- a/bt5/erp5_item/bt/revision +++ b/bt5/erp5_item/bt/revision @@ -1 +1 @@ -216 \ No newline at end of file +218 \ No newline at end of file -- 2.30.9