From 19f9b7b66b3403042f20d33e3d97b9ada4ddbd15 Mon Sep 17 00:00:00 2001 From: Yoshinori Okuji <yo@nexedi.com> Date: Thu, 20 May 2010 22:27:12 +0000 Subject: [PATCH] 2010-05-21 yo * Add a new action Reset Prices into Sale Order, Sale Packing List, Purchase Order, and Purchase Packing List. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35505 20353a03-c40f-0410-a6d1-a30d3c3de9de --- .../reset_movement_price_list.xml | 91 +++++++++++ .../reset_movement_price_list.xml | 91 +++++++++++ .../reset_movement_price_list.xml | 91 +++++++++++ .../reset_movement_price_list.xml | 91 +++++++++++ .../Delivery_resetMovementPriceList.xml | 149 ++++++++++++++++++ bt5/erp5_trade/bt/change_log | 3 + bt5/erp5_trade/bt/revision | 2 +- bt5/erp5_trade/bt/template_action_path_list | 4 + 8 files changed, 521 insertions(+), 1 deletion(-) create mode 100644 bt5/erp5_trade/ActionTemplateItem/portal_types/Purchase%20Order/reset_movement_price_list.xml create mode 100644 bt5/erp5_trade/ActionTemplateItem/portal_types/Purchase%20Packing%20List/reset_movement_price_list.xml create mode 100644 bt5/erp5_trade/ActionTemplateItem/portal_types/Sale%20Order/reset_movement_price_list.xml create mode 100644 bt5/erp5_trade/ActionTemplateItem/portal_types/Sale%20Packing%20List/reset_movement_price_list.xml create mode 100644 bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_resetMovementPriceList.xml diff --git a/bt5/erp5_trade/ActionTemplateItem/portal_types/Purchase%20Order/reset_movement_price_list.xml b/bt5/erp5_trade/ActionTemplateItem/portal_types/Purchase%20Order/reset_movement_price_list.xml new file mode 100644 index 0000000000..d612169f1a --- /dev/null +++ b/bt5/erp5_trade/ActionTemplateItem/portal_types/Purchase%20Order/reset_movement_price_list.xml @@ -0,0 +1,91 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <tuple> + <global name="ActionInformation" module="Products.CMFCore.ActionInformation"/> + <tuple/> + </tuple> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>action</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> + </value> + </item> + <item> + <key> <string>categories</string> </key> + <value> + <tuple> + <string>action_type/object_action</string> + </tuple> + </value> + </item> + <item> + <key> <string>category</string> </key> + <value> <string>object_action</string> </value> + </item> + <item> + <key> <string>condition</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>icon</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>reset_movement_price_list</string> </value> + </item> + <item> + <key> <string>permissions</string> </key> + <value> + <tuple> + <string>Modify portal content</string> + </tuple> + </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> <string>Action Information</string> </value> + </item> + <item> + <key> <string>priority</string> </key> + <value> <float>7.0</float> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string>Reset Prices</string> </value> + </item> + <item> + <key> <string>visible</string> </key> + <value> <int>1</int> </value> + </item> + </dictionary> + </pickle> + </record> + <record id="2" aka="AAAAAAAAAAI="> + <pickle> + <tuple> + <global name="Expression" module="Products.CMFCore.Expression"/> + <tuple/> + </tuple> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>text</string> </key> + <value> <string>string:${object_url}/Delivery_resetMovementPriceList</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_trade/ActionTemplateItem/portal_types/Purchase%20Packing%20List/reset_movement_price_list.xml b/bt5/erp5_trade/ActionTemplateItem/portal_types/Purchase%20Packing%20List/reset_movement_price_list.xml new file mode 100644 index 0000000000..5a0505a3e6 --- /dev/null +++ b/bt5/erp5_trade/ActionTemplateItem/portal_types/Purchase%20Packing%20List/reset_movement_price_list.xml @@ -0,0 +1,91 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <tuple> + <global name="ActionInformation" module="Products.CMFCore.ActionInformation"/> + <tuple/> + </tuple> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>action</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> + </value> + </item> + <item> + <key> <string>categories</string> </key> + <value> + <tuple> + <string>action_type/object_action</string> + </tuple> + </value> + </item> + <item> + <key> <string>category</string> </key> + <value> <string>object_action</string> </value> + </item> + <item> + <key> <string>condition</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>icon</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>reset_movement_price_list</string> </value> + </item> + <item> + <key> <string>permissions</string> </key> + <value> + <tuple> + <string>Modify portal content</string> + </tuple> + </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> <string>Action Information</string> </value> + </item> + <item> + <key> <string>priority</string> </key> + <value> <float>8.0</float> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string>Reset Prices</string> </value> + </item> + <item> + <key> <string>visible</string> </key> + <value> <int>1</int> </value> + </item> + </dictionary> + </pickle> + </record> + <record id="2" aka="AAAAAAAAAAI="> + <pickle> + <tuple> + <global name="Expression" module="Products.CMFCore.Expression"/> + <tuple/> + </tuple> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>text</string> </key> + <value> <string>string:${object_url}/Delivery_resetMovementPriceList</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_trade/ActionTemplateItem/portal_types/Sale%20Order/reset_movement_price_list.xml b/bt5/erp5_trade/ActionTemplateItem/portal_types/Sale%20Order/reset_movement_price_list.xml new file mode 100644 index 0000000000..5a0505a3e6 --- /dev/null +++ b/bt5/erp5_trade/ActionTemplateItem/portal_types/Sale%20Order/reset_movement_price_list.xml @@ -0,0 +1,91 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <tuple> + <global name="ActionInformation" module="Products.CMFCore.ActionInformation"/> + <tuple/> + </tuple> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>action</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> + </value> + </item> + <item> + <key> <string>categories</string> </key> + <value> + <tuple> + <string>action_type/object_action</string> + </tuple> + </value> + </item> + <item> + <key> <string>category</string> </key> + <value> <string>object_action</string> </value> + </item> + <item> + <key> <string>condition</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>icon</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>reset_movement_price_list</string> </value> + </item> + <item> + <key> <string>permissions</string> </key> + <value> + <tuple> + <string>Modify portal content</string> + </tuple> + </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> <string>Action Information</string> </value> + </item> + <item> + <key> <string>priority</string> </key> + <value> <float>8.0</float> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string>Reset Prices</string> </value> + </item> + <item> + <key> <string>visible</string> </key> + <value> <int>1</int> </value> + </item> + </dictionary> + </pickle> + </record> + <record id="2" aka="AAAAAAAAAAI="> + <pickle> + <tuple> + <global name="Expression" module="Products.CMFCore.Expression"/> + <tuple/> + </tuple> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>text</string> </key> + <value> <string>string:${object_url}/Delivery_resetMovementPriceList</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_trade/ActionTemplateItem/portal_types/Sale%20Packing%20List/reset_movement_price_list.xml b/bt5/erp5_trade/ActionTemplateItem/portal_types/Sale%20Packing%20List/reset_movement_price_list.xml new file mode 100644 index 0000000000..5a0505a3e6 --- /dev/null +++ b/bt5/erp5_trade/ActionTemplateItem/portal_types/Sale%20Packing%20List/reset_movement_price_list.xml @@ -0,0 +1,91 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <tuple> + <global name="ActionInformation" module="Products.CMFCore.ActionInformation"/> + <tuple/> + </tuple> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>action</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> + </value> + </item> + <item> + <key> <string>categories</string> </key> + <value> + <tuple> + <string>action_type/object_action</string> + </tuple> + </value> + </item> + <item> + <key> <string>category</string> </key> + <value> <string>object_action</string> </value> + </item> + <item> + <key> <string>condition</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>icon</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>reset_movement_price_list</string> </value> + </item> + <item> + <key> <string>permissions</string> </key> + <value> + <tuple> + <string>Modify portal content</string> + </tuple> + </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> <string>Action Information</string> </value> + </item> + <item> + <key> <string>priority</string> </key> + <value> <float>8.0</float> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string>Reset Prices</string> </value> + </item> + <item> + <key> <string>visible</string> </key> + <value> <int>1</int> </value> + </item> + </dictionary> + </pickle> + </record> + <record id="2" aka="AAAAAAAAAAI="> + <pickle> + <tuple> + <global name="Expression" module="Products.CMFCore.Expression"/> + <tuple/> + </tuple> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>text</string> </key> + <value> <string>string:${object_url}/Delivery_resetMovementPriceList</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_resetMovementPriceList.xml b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_resetMovementPriceList.xml new file mode 100644 index 0000000000..9e70c1b242 --- /dev/null +++ b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_resetMovementPriceList.xml @@ -0,0 +1,149 @@ +<?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># This script sets zero to the prices of all movements, so that\n +# prices will be recalculated.\n +\n +portal = context.getPortalObject()\n +# We do not want to reset all kinds of movements (e.g. Accounting Movements).\n +portal_type_list = portal.getPortalInvoiceMovementTypeList() \\\n + + portal.getPortalOrderMovementTypeList() \\\n + + portal.getPortalDeliveryMovementTypeList()\n +for movement in context.getMovementList(portal_type=portal_type_list):\n + movement.edit(price=None)\n +\n +if not batch_mode:\n + message = context.Base_translateString(\'Prices reset.\')\n + return context.Base_redirect(form_id,\n + keep_items=dict(portal_status_message=message))\n +</string> </value> + </item> + <item> + <key> <string>_code</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>_params</string> </key> + <value> <string>form_id=\'view\', batch_mode=0, **kw</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>2</int> </value> + </item> + <item> + <key> <string>co_varnames</string> </key> + <value> + <tuple> + <string>form_id</string> + <string>batch_mode</string> + <string>kw</string> + <string>_getattr_</string> + <string>context</string> + <string>portal</string> + <string>portal_type_list</string> + <string>_getiter_</string> + <string>movement</string> + <string>None</string> + <string>message</string> + <string>dict</string> + </tuple> + </value> + </item> + </dictionary> + </state> + </object> + </value> + </item> + <item> + <key> <string>func_defaults</string> </key> + <value> + <tuple> + <string>view</string> + <int>0</int> + </tuple> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>Delivery_resetMovementPriceList</string> </value> + </item> + <item> + <key> <string>warnings</string> </key> + <value> + <tuple/> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_trade/bt/change_log b/bt5/erp5_trade/bt/change_log index c9461ec4b9..56b8a867bf 100644 --- a/bt5/erp5_trade/bt/change_log +++ b/bt5/erp5_trade/bt/change_log @@ -1,3 +1,6 @@ +2010-05-21 yo +* Add a new action Reset Prices into Sale Order, Sale Packing List, Purchase Order, and Purchase Packing List. + 2010-05-18 yo * Change the default of rounding to False, as it is currently very slow to apply rounding models. So those who want to use this feature should enable it explicitly. diff --git a/bt5/erp5_trade/bt/revision b/bt5/erp5_trade/bt/revision index 930e0e0f80..1c8a8a857f 100644 --- a/bt5/erp5_trade/bt/revision +++ b/bt5/erp5_trade/bt/revision @@ -1 +1 @@ -930 \ No newline at end of file +932 \ No newline at end of file diff --git a/bt5/erp5_trade/bt/template_action_path_list b/bt5/erp5_trade/bt/template_action_path_list index db9d9366d8..2e95f3f229 100644 --- a/bt5/erp5_trade/bt/template_action_path_list +++ b/bt5/erp5_trade/bt/template_action_path_list @@ -72,6 +72,7 @@ Purchase Order | jump_to_related_purchase_packing_list Purchase Order | order_print Purchase Order | payment_condition Purchase Order | profile_view +Purchase Order | reset_movement_price_list Purchase Order | view Purchase Order | view_stock Purchase Order | view_trade_model @@ -91,6 +92,7 @@ Purchase Packing List | jump_related_purchase_invoice Purchase Packing List | packing_list_print Purchase Packing List | payment_condition Purchase Packing List | profile_view +Purchase Packing List | reset_movement_price_list Purchase Packing List | view Purchase Packing List | view_stock Purchase Trade Condition Module | view @@ -142,6 +144,7 @@ Sale Order | order_summary Sale Order | payment_condition Sale Order | profile_view Sale Order | reference_generate +Sale Order | reset_movement_price_list Sale Order | sale_order_fast_input Sale Order | sale_order_planning Sale Order | view @@ -163,6 +166,7 @@ Sale Packing List | jump_related_sale_invoice Sale Packing List | packing_list_print Sale Packing List | payment_condition Sale Packing List | profile_view +Sale Packing List | reset_movement_price_list Sale Packing List | sale_packing_list_fast_input Sale Packing List | view Sale Packing List | view_container_list -- 2.30.9