diff --git a/bt5/erp5_apparel/ActionTemplateItem/portal_types/Apparel%20Model/copy_composition.xml b/bt5/erp5_apparel/ActionTemplateItem/portal_types/Apparel%20Model/copy_composition.xml new file mode 100644 index 0000000000000000000000000000000000000000..96d945d2eb5ba7abcb662eb58be82551b42718f5 --- /dev/null +++ b/bt5/erp5_apparel/ActionTemplateItem/portal_types/Apparel%20Model/copy_composition.xml @@ -0,0 +1,77 @@ +<?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>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> <string></string> </value> + </item> + <item> + <key> <string>icon</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>copy_composition</string> </value> + </item> + <item> + <key> <string>permissions</string> </key> + <value> + <tuple> + <string>View</string> + </tuple> + </value> + </item> + <item> + <key> <string>priority</string> </key> + <value> <float>8.0</float> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string>Copy Composition</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}/ApparelModel_copyComposition</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/ApparelModel_copyComposition.xml b/bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/ApparelModel_copyComposition.xml new file mode 100644 index 0000000000000000000000000000000000000000..fec93a6eb943f5bcd964c45eb7993b0c1f4018e1 --- /dev/null +++ b/bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/ApparelModel_copyComposition.xml @@ -0,0 +1,168 @@ +<?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>cell_id_list = []\n +colour_range = context.getSpecialiseValue(portal_type=\'Apparel Colour Range\')\n +if colour_range is not None and len(colour_range.contentValues(portal_type=\'Apparel Colour Range Variation\')) != 0:\n + colour_variation = colour_range.contentValues(portal_type=\'Apparel Colour Range Variation\')[0]\n + apparel_fabric_colour_variation = colour_variation.getSpecialiseValue(portal_type=\'Apparel Fabric Colour Variation\')\n + if apparel_fabric_colour_variation is not None:\n + fabric = apparel_fabric_colour_variation.getParentValue()\n + composition_list = fabric.getCompositionList()\n + # get cells\n + poly_list = fabric.ApparelFabric_asCellRange(matrixbox=1)[0]\n + for cat, title in poly_list:\n + cell = fabric.getCell(cat, base_id=\'composition\')\n + if cell is not None:\n + cell_id_list.append(cell.getId())\n +\n +if len(cell_id_list):\n + copy_data = fabric.manage_copyObjects(cell_id_list)\n + context.manage_pasteObjects(copy_data)\n + context.setCompositionList(composition_list)\n + msg = \'%s %s\' % (len(cell_id_list), context.Base_translateString(\'Composition Pasted.\'))\n +else:\n + msg = \'No Composition found\'\n +\n +return context.Base_redirect(form_id=form_id,\n + keep_items = dict(portal_status_message=msg,\n + editable_mode = context.REQUEST.get(\'editable_mode\', 0)))\n +return msg\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\'</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>1</int> </value> + </item> + <item> + <key> <string>co_varnames</string> </key> + <value> + <tuple> + <string>form_id</string> + <string>cell_id_list</string> + <string>_getattr_</string> + <string>context</string> + <string>colour_range</string> + <string>None</string> + <string>len</string> + <string>_getitem_</string> + <string>colour_variation</string> + <string>apparel_fabric_colour_variation</string> + <string>fabric</string> + <string>composition_list</string> + <string>poly_list</string> + <string>_getiter_</string> + <string>cat</string> + <string>title</string> + <string>cell</string> + <string>copy_data</string> + <string>msg</string> + <string>dict</string> + </tuple> + </value> + </item> + </dictionary> + </state> + </object> + </value> + </item> + <item> + <key> <string>func_defaults</string> </key> + <value> + <tuple> + <string>view</string> + </tuple> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>ApparelModel_copyComposition</string> </value> + </item> + <item> + <key> <string>warnings</string> </key> + <value> + <tuple/> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_apparel/bt/revision b/bt5/erp5_apparel/bt/revision index f0b5c72cad2a31240e128db4bc833e782855f796..fc9afb48e033d9a7d2a778e81ae0e9424950c1cd 100644 --- a/bt5/erp5_apparel/bt/revision +++ b/bt5/erp5_apparel/bt/revision @@ -1 +1 @@ -57 \ No newline at end of file +59 \ No newline at end of file diff --git a/bt5/erp5_apparel/bt/template_action_path_list b/bt5/erp5_apparel/bt/template_action_path_list index a355c2ad984b1c699ef60f5ddd1dadb4de3c78da..45ebb198f0c44deb7eb41efbb5d62e31903a7822 100644 --- a/bt5/erp5_apparel/bt/template_action_path_list +++ b/bt5/erp5_apparel/bt/template_action_path_list @@ -109,6 +109,7 @@ Apparel Model Module | view Apparel Model Module | workflow_report Apparel Model Morphology Variation | view Apparel Model | copy_colour_range_variation +Apparel Model | copy_composition Apparel Model | development Apparel Model | inventory_view Apparel Model | jump_to_related_apparel_model