Commit 5f5c6019 authored by Fabien Morin's avatar Fabien Morin

add action and related script to copy composition from apparel fabric related...

add action and related script to copy composition from apparel fabric related to the current Apparel Model

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29377 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1a5ce138
<?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>
<?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>
57
\ No newline at end of file
59
\ No newline at end of file
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment