Commit 1a5ce138 authored by Fabien Morin's avatar Fabien Morin

- remove composition list_field from main views and put it in composition views.

- add a fields on main view : 'composition_title' which call a script to display a text explaining what the current apparel is made of (it use composition matrixbox)
- make possible to define composition on apparel components

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29376 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent bd23f2d3
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
</item> </item>
<item> <item>
<key> <string>priority</string> </key> <key> <string>priority</string> </key>
<value> <float>3.0</float> </value> <value> <float>4.0</float> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
</item> </item>
<item> <item>
<key> <string>priority</string> </key> <key> <string>priority</string> </key>
<value> <float>4.0</float> </value> <value> <float>5.0</float> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
<?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_view</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>view_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>3.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>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}/ApparelFabric_viewComposition</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
<item>Purchase Supply Line</item> <item>Purchase Supply Line</item>
<item>Sale Supply Line</item> <item>Sale Supply Line</item>
<item>Apparel Component Variation</item> <item>Apparel Component Variation</item>
<item>Mapped Value</item>
<item>Supply Line</item> <item>Supply Line</item>
</portal_type> </portal_type>
<portal_type id="Apparel Component Module"> <portal_type id="Apparel Component Module">
......
<hidden_content_type_list> <hidden_content_type_list>
<portal_type id="Apparel Component"> <portal_type id="Apparel Component">
<item>Sale Supply Line</item> <item>Sale Supply Line</item>
<item>Mapped Value</item>
<item>Supply Line</item> <item>Supply Line</item>
<item>Purchase Supply Line</item> <item>Purchase Supply Line</item>
</portal_type> </portal_type>
......
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
<string>my_resource</string> <string>my_resource</string>
<string>my_trade_description</string> <string>my_trade_description</string>
<string>my_collection_list</string> <string>my_collection_list</string>
<string>my_composition_list</string> <string>composition_title</string>
</list> </list>
</value> </value>
</item> </item>
......
...@@ -94,6 +94,7 @@ ...@@ -94,6 +94,7 @@
<string>my_raw_width</string> <string>my_raw_width</string>
<string>my_net_width</string> <string>my_net_width</string>
<string>my_base_weight</string> <string>my_base_weight</string>
<string>composition_title</string>
</list> </list>
</value> </value>
</item> </item>
......
...@@ -92,7 +92,9 @@ ...@@ -92,7 +92,9 @@
<item> <item>
<key> <string>left</string> </key> <key> <string>left</string> </key>
<value> <value>
<list/> <list>
<string>my_composition_list</string>
</list>
</value> </value>
</item> </item>
<item> <item>
......
...@@ -97,10 +97,10 @@ ...@@ -97,10 +97,10 @@
<string>my_origin</string> <string>my_origin</string>
<string>my_apparel_model_template_title</string> <string>my_apparel_model_template_title</string>
<string>my_apparel_cloth_title_list</string> <string>my_apparel_cloth_title_list</string>
<string>my_composition_list</string>
<string>my_ean13_code</string> <string>my_ean13_code</string>
<string>my_tariff_nomenclature</string> <string>my_tariff_nomenclature</string>
<string>my_transformation_state_list</string> <string>my_transformation_state_list</string>
<string>composition_title</string>
</list> </list>
</value> </value>
</item> </item>
......
<?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 is used to display a small text in the main form corresponding to the composition\n
# it return something like "3.0 % Polyamide, 5.0 % Elasthanne"\n
\n
title_list = []\n
poly_list = context.ApparelFabric_asCellRange(matrixbox=1)[0]\n
for cat, title in poly_list:\n
cell = context.getCell(cat, base_id=\'composition\')\n
if cell is not None:\n
quantity = cell.getQuantity()\n
text = \'%s %% %s\' % (quantity*100, title)\n
title_list.append(text)\n
final_text = \', \'.join(title_list)\n
return final_text\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>title_list</string>
<string>_getitem_</string>
<string>_getattr_</string>
<string>context</string>
<string>poly_list</string>
<string>_getiter_</string>
<string>cat</string>
<string>title</string>
<string>cell</string>
<string>None</string>
<string>quantity</string>
<string>text</string>
<string>final_text</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>Apparel_getCompositionTitle</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
56 57
\ No newline at end of file \ No newline at end of file
...@@ -52,6 +52,7 @@ Apparel Component | instruction_view ...@@ -52,6 +52,7 @@ Apparel Component | instruction_view
Apparel Component | purchase_price_view Apparel Component | purchase_price_view
Apparel Component | sale_price_view Apparel Component | sale_price_view
Apparel Component | view Apparel Component | view
Apparel Component | view_composition
Apparel Consumption Module | csv_export Apparel Consumption Module | csv_export
Apparel Consumption Module | csv_import Apparel Consumption Module | csv_import
Apparel Consumption Module | list_ui Apparel Consumption Module | list_ui
......
...@@ -8,6 +8,7 @@ Apparel Colour Range Module | Apparel Colour Range ...@@ -8,6 +8,7 @@ Apparel Colour Range Module | Apparel Colour Range
Apparel Colour Range | Apparel Colour Range Variation Apparel Colour Range | Apparel Colour Range Variation
Apparel Component Module | Apparel Component Apparel Component Module | Apparel Component
Apparel Component | Apparel Component Variation Apparel Component | Apparel Component Variation
Apparel Component | Mapped Value
Apparel Component | Purchase Supply Line Apparel Component | Purchase Supply Line
Apparel Component | Sale Supply Line Apparel Component | Sale Supply Line
Apparel Component | Supply Line Apparel Component | Supply Line
......
Apparel Component | Mapped Value
Apparel Component | Purchase Supply Line Apparel Component | Purchase Supply Line
Apparel Component | Sale Supply Line Apparel Component | Sale Supply Line
Apparel Component | Supply Line Apparel Component | Supply Line
......
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