diff --git a/product/ERP5/skins/erp5_core/Delivery_mergeDeliveryList.py b/product/ERP5/skins/erp5_core/Delivery_mergeDeliveryList.py new file mode 100755 index 0000000000000000000000000000000000000000..87bcbd5d68777bf3f0e1b61d69c9237dc9bc2e9b --- /dev/null +++ b/product/ERP5/skins/erp5_core/Delivery_mergeDeliveryList.py @@ -0,0 +1,25 @@ +## Script (Python) "Delivery_mergeDeliveryList" +##bind container=container +##bind context=context +##bind namespace= +##bind script=script +##bind subpath=traverse_subpath +##parameters=form_id='' +##title=Merge deliveries into one +## +REQUEST=context.REQUEST +selection_name = REQUEST['selection_name'] +object_list = context.portal_selections.getSelectionValueList(selection_name, context=context, REQUEST=REQUEST) +delivery_list = [] +for o in object_list: + delivery_list.append(o) + +if len(delivery_list) < 2: + ret_url = context.absolute_url() + '/' + form_id + qs = '?portal_status_message=Please+select+more+than+one+items.' +else: + ret_url = context.absolute_url() + '/' + form_id + qs = '?portal_status_message=Merged.' + context.portal_simulation.mergeDeliveryList(delivery_list) + +return REQUEST.RESPONSE.redirect( ret_url + qs ) diff --git a/product/ERP5/skins/erp5_core/Delivery_mergedDeliveryListForm.form b/product/ERP5/skins/erp5_core/Delivery_mergedDeliveryListForm.form new file mode 100755 index 0000000000000000000000000000000000000000..769336a5b79a19153e8f45002af7447b7fe3076b --- /dev/null +++ b/product/ERP5/skins/erp5_core/Delivery_mergedDeliveryListForm.form @@ -0,0 +1,87 @@ +<?xml version="1.0"?> + +<form> + <title>Merge the deliveries</title> + <row_length>4</row_length> + <name>Delivery_mergedDeliveryListForm</name> + <pt>form_view_dialog</pt> + <action>Delivery_mergeDeliveryList</action> + <method>POST</method> + <enctype></enctype> + <encoding>UTF-8</encoding> + <stored_encoding>ISO-8859-1</stored_encoding> + <unicode_mode>false</unicode_mode> + <groups> + <group> + <title>left</title> + <fields> + + </fields> + </group> + <group> + <title>right</title> + <fields> + + </fields> + </group> + <group> + <title>center</title> + <fields> + + </fields> + </group> + <group> + <title>bottom</title> + <fields> + + <field><id>listbox</id> <type>ListBox</type> + <values> + <all_columns type="list">[('id', 'R\xe9f\xe9rence'), ('portal_type', 'Type'), ('Title', 'Titre'), ('relative_url', "Chemin d'acc\xe8s"), ('Description', 'Description')]</all_columns> + <all_editable_columns type="list">[]</all_editable_columns> + <alternate_name></alternate_name> + <columns type="list">[('id', 'R\xe9f\xe9rence'), ('portal_type', 'Type'), ('Title', 'Titre'), ('relative_url', "Chemin d'acc\xe8s"), ('Description', 'Description')]</columns> + <css_class></css_class> + <default></default> + <default_params type="list">[('id', "''"), ('relative_url', "''"), ('portal_type', "''"), ('Description', "''")]</default_params> + <description></description> + <domain_root_list type="list">[]</domain_root_list> + <domain_tree type="int">0</domain_tree> + <editable type="int">1</editable> + <editable_columns type="list">[]</editable_columns> + <enabled type="int">1</enabled> + <external_validator></external_validator> + <global_attributes type="list">[]</global_attributes> + <hidden type="int">0</hidden> + <lines type="int">30</lines> + <list_action>folder_contents</list_action> + <list_method></list_method> + <meta_types type="list">[]</meta_types> + <portal_types type="list">[]</portal_types> + <report_root_list type="list">[]</report_root_list> + <report_tree type="int">0</report_tree> + <search type="int">0</search> + <search_columns type="list">[]</search_columns> + <select type="int">0</select> + <selection_name></selection_name> + <sort type="list">[('relative_url', 'relative_url')]</sort> + <stat_method></stat_method> + <title>Merged deliveries</title> + </values> + <tales> + <list_method>python:None</list_method> + <selection_name>here/REQUEST/form/selection_name</selection_name> + </tales> + <messages> + <message name="external_validator_failed">The input failed the external validator.</message> + </messages> + </field> + </fields> + </group> + <group> + <title>hidden</title> + <fields> + + </fields> + </group> + </groups> +</form> \ No newline at end of file