Commit 32b2a1c0 authored by Arnaud Fontaine's avatar Arnaud Fontaine

Allow to jump from Organisation to its related Sale Supplies, Internal...

Allow to jump from Organisation to its related Sale Supplies, Internal Supplies and Purchase Supplies.
parent a5612a1f
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</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_jump</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_jump</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>jump_to_internal_supply</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>20.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Internal Supply</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/Organisation_jumpToRelatedObjectList?portal_type=Internal+Supply</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</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_jump</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_jump</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>jump_to_purchase_supply</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>19.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Purchase Supply</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/Organisation_jumpToRelatedObjectList?portal_type=Purchase+Supply</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</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_jump</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_jump</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>jump_to_sale_supply</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>18.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Sale Supply</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/Organisation_jumpToRelatedObjectList?portal_type=Sale+Supply</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</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>"""\n
Jump from Organisation to its related objects (but only if used as\n
source* or destination* categories) of the same portal type and\n
displayed using the module view\n
\n
XXX: move this code to erp5_core if needed elsewhere?\n
"""\n
portal = context.getPortalObject()\n
\n
# XXX: Seems there is no other better way to get the Arrow\n
# destination/section categories...\n
base_category_list = []\n
for arrow_property in portal.portal_property_sheets.Arrow.contentValues():\n
if arrow_property.getPortalType() != \'Category Property\':\n
continue\n
\n
arrow_property_title = arrow_property.getTitle()\n
if (arrow_property_title.startswith(\'source\') or\n
arrow_property_title.startswith(\'destination\')):\n
base_category_list.append(arrow_property_title)\n
\n
related_object_list = context.getRelatedValueList(\n
checked_permission=\'View\',\n
base_category_list=base_category_list,\n
portal_type=portal_type)\n
\n
if not related_object_list:\n
message = portal.Base_translateString(\'No ${portal_type} related.\',\n
mapping={\'portal_type\': portal_type})\n
\n
return context.Base_redirect(keep_items=dict(portal_status_message=message))\n
\n
elif len(related_object_list) == 1:\n
related_object = related_object_list[0]\n
message = portal.Base_translateString(\n
\'${this_portal_type} related to ${that_portal_type}: ${that_title}.\',\n
mapping={"this_portal_type": related_object.getTranslatedPortalType(),\n
"that_portal_type": context.getTranslatedPortalType(),\n
"that_title": context.getTitleOrId()})\n
\n
return related_object.Base_redirect(\n
keep_items=dict(reset=1,\n
portal_status_message=message))\n
\n
else:\n
# XXX: Use POST rather than GET because of GET URL length limitation?\n
return portal.getDefaultModule(portal_type).Base_redirect(\n
keep_items={\'reset\': 1,\n
\'uid\': [obj.getUid() for obj in related_object_list]})\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>portal_type</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Organisation_jumpToRelatedObjectList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
2011-12-14 arnaud.fontaine
* Allow to jump from Organisation to its related Sale Supplies, Internal Supplies and Purchase Supplies.
2011-12-13 arnaud.fontaine 2011-12-13 arnaud.fontaine
* Allow to jump from Product to its related Transformation using it as Material as well. * Allow to jump from Product to its related Transformation using it as Material as well.
......
569 570
\ No newline at end of file \ No newline at end of file
...@@ -22,6 +22,9 @@ Internal Supply Module | view ...@@ -22,6 +22,9 @@ Internal Supply Module | view
Internal Supply | view Internal Supply | view
Internal Supply | view_profile Internal Supply | view_profile
Measure | view Measure | view
Organisation | jump_to_internal_supply
Organisation | jump_to_purchase_supply
Organisation | jump_to_sale_supply
Product Individual Variation | view Product Individual Variation | view
Product Module | converted_inventory_report Product Module | converted_inventory_report
Product Module | transformed_inventory_report Product Module | transformed_inventory_report
......
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