From 0fd2bb1d2b3138842e71fd29879b337a402d175e Mon Sep 17 00:00:00 2001 From: Yusei Tahara <yusei@nexedi.com> Date: Fri, 21 May 2010 13:40:50 +0000 Subject: [PATCH] 2010-05-21 yusei * Display preferred base amounts in base contribution list and base application list. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35534 20353a03-c40f-0410-a6d1-a30d3c3de9de --- ...se_getPreferredTradeBaseAmountItemList.xml | 147 ++++++++++++++++++ .../my_view_mode_base_application_list.xml | 18 ++- .../my_view_mode_base_contribution_list.xml | 18 ++- bt5/erp5_trade/bt/change_log | 3 + bt5/erp5_trade/bt/revision | 2 +- 5 files changed, 183 insertions(+), 5 deletions(-) create mode 100644 bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Base_getPreferredTradeBaseAmountItemList.xml diff --git a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Base_getPreferredTradeBaseAmountItemList.xml b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Base_getPreferredTradeBaseAmountItemList.xml new file mode 100644 index 0000000000..a11e6477d5 --- /dev/null +++ b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Base_getPreferredTradeBaseAmountItemList.xml @@ -0,0 +1,147 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <tuple> + <global name="PythonScript" module="Products.PythonScripts.PythonScript"/> + <tuple/> + </tuple> + </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>from Products.ERP5Type.Utils import UpperCase\n +\n +portal_categories = context.portal_categories\n +portal_preferences = context.portal_preferences\n +method_id = portal_preferences.getPreference(\'preferred_category_child_item_list_method_id\', \'getCategoryChildCompactLogicalPathItemList\')\n +\n +item_list = getattr(portal_categories.base_amount, method_id)(local_sort_id=(\'int_index\', \'translated_title\'), checked_permission=\'View\', base=1)\n +preferred_list = portal_preferences.getPreferredTradeBaseAmountList()\n +\n +if not preferred_list:\n + return item_list\n +else:\n + return [item for item in item_list if item[1] in preferred_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>Products.ERP5Type.Utils</string> + <string>UpperCase</string> + <string>_getattr_</string> + <string>context</string> + <string>portal_categories</string> + <string>portal_preferences</string> + <string>method_id</string> + <string>getattr</string> + <string>item_list</string> + <string>preferred_list</string> + <string>append</string> + <string>$append0</string> + <string>_getiter_</string> + <string>item</string> + <string>_getitem_</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>Base_getPreferredTradeBaseAmountItemList</string> </value> + </item> + <item> + <key> <string>warnings</string> </key> + <value> + <tuple/> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Base_viewTradeFieldLibrary/my_view_mode_base_application_list.xml b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Base_viewTradeFieldLibrary/my_view_mode_base_application_list.xml index 74e47e23c7..77dec2fc4a 100644 --- a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Base_viewTradeFieldLibrary/my_view_mode_base_application_list.xml +++ b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Base_viewTradeFieldLibrary/my_view_mode_base_application_list.xml @@ -14,8 +14,8 @@ <value> <list> <string>description</string> - <string>title</string> <string>items</string> + <string>title</string> </list> </value> </item> @@ -57,6 +57,10 @@ <key> <string>tales</string> </key> <value> <dictionary> + <item> + <key> <string>description</string> </key> + <value> <string></string> </value> + </item> <item> <key> <string>field_id</string> </key> <value> <string></string> </value> @@ -75,6 +79,10 @@ <key> <string>target</string> </key> <value> <string></string> </value> </item> + <item> + <key> <string>title</string> </key> + <value> <string></string> </value> + </item> </dictionary> </value> </item> @@ -94,6 +102,12 @@ <key> <string>form_id</string> </key> <value> <string>Base_viewFieldLibrary</string> </value> </item> + <item> + <key> <string>items</string> </key> + <value> + <list/> + </value> + </item> <item> <key> <string>target</string> </key> <value> <string>Click to edit the target</string> </value> @@ -119,7 +133,7 @@ <dictionary> <item> <key> <string>_text</string> </key> - <value> <string>python: getattr(here.portal_categories.base_amount, preferences.getPreference(\'preferred_category_child_item_list_method_id\', \'getCategoryChildCompactLogicalPathItemList\'))(base=1, local_sort_id=(\'int_index\', \'translated_title\'), checked_permission=\'View\')</string> </value> + <value> <string>here/Base_getPreferredTradeBaseAmountItemList</string> </value> </item> </dictionary> </pickle> diff --git a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Base_viewTradeFieldLibrary/my_view_mode_base_contribution_list.xml b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Base_viewTradeFieldLibrary/my_view_mode_base_contribution_list.xml index 61049865e1..7af6d1eb90 100644 --- a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Base_viewTradeFieldLibrary/my_view_mode_base_contribution_list.xml +++ b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Base_viewTradeFieldLibrary/my_view_mode_base_contribution_list.xml @@ -14,8 +14,8 @@ <value> <list> <string>description</string> - <string>title</string> <string>items</string> + <string>title</string> </list> </value> </item> @@ -57,6 +57,10 @@ <key> <string>tales</string> </key> <value> <dictionary> + <item> + <key> <string>description</string> </key> + <value> <string></string> </value> + </item> <item> <key> <string>field_id</string> </key> <value> <string></string> </value> @@ -75,6 +79,10 @@ <key> <string>target</string> </key> <value> <string></string> </value> </item> + <item> + <key> <string>title</string> </key> + <value> <string></string> </value> + </item> </dictionary> </value> </item> @@ -94,6 +102,12 @@ <key> <string>form_id</string> </key> <value> <string>Base_viewFieldLibrary</string> </value> </item> + <item> + <key> <string>items</string> </key> + <value> + <list/> + </value> + </item> <item> <key> <string>target</string> </key> <value> <string>Click to edit the target</string> </value> @@ -119,7 +133,7 @@ <dictionary> <item> <key> <string>_text</string> </key> - <value> <string>python: getattr(here.portal_categories.base_amount, preferences.getPreference(\'preferred_category_child_item_list_method_id\', \'getCategoryChildCompactLogicalPathItemList\'))(base=1, local_sort_id=(\'int_index\', \'translated_title\'), checked_permission=\'View\')</string> </value> + <value> <string>here/Base_getPreferredTradeBaseAmountItemList</string> </value> </item> </dictionary> </pickle> diff --git a/bt5/erp5_trade/bt/change_log b/bt5/erp5_trade/bt/change_log index f31e840515..b73a7da89f 100644 --- a/bt5/erp5_trade/bt/change_log +++ b/bt5/erp5_trade/bt/change_log @@ -1,3 +1,6 @@ +2010-05-21 yusei +* Display preferred base amounts in base contribution list and base application list. + 2010-05-21 yusei * Change base amount preference. Only one preferred list on trade is enough. * Revert previous changes. On movements, display uses defined on the corresponding resource only. diff --git a/bt5/erp5_trade/bt/revision b/bt5/erp5_trade/bt/revision index 90afd51b60..dcdf7f59d9 100644 --- a/bt5/erp5_trade/bt/revision +++ b/bt5/erp5_trade/bt/revision @@ -1 +1 @@ -940 \ No newline at end of file +942 \ No newline at end of file -- 2.30.9