diff --git a/bt5/erp5_invoicing/ActionTemplateItem/portal_types/Purchase%20Invoice%20Transaction/jump_related_order.xml b/bt5/erp5_invoicing/ActionTemplateItem/portal_types/Purchase%20Invoice%20Transaction/jump_related_order.xml new file mode 100644 index 0000000000000000000000000000000000000000..6a8124f202fd317cb26d434eb3cf44678446aab6 --- /dev/null +++ b/bt5/erp5_invoicing/ActionTemplateItem/portal_types/Purchase%20Invoice%20Transaction/jump_related_order.xml @@ -0,0 +1,87 @@ +<?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>__ac_local_roles__</string> </key> + <value> + <none/> + </value> + </item> + <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_jump</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>jump_related_order</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>10.0</float> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string>Related Purchase Order</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 encoding="cdata"><![CDATA[ + +string:${object_url}/Invoice_jumpToOrder?packing_list_type=Sale%20Packing%20List&order_type=Sale%20Order + +]]></string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_invoicing/ActionTemplateItem/portal_types/Sale%20Invoice%20Transaction/jump_related_order.xml b/bt5/erp5_invoicing/ActionTemplateItem/portal_types/Sale%20Invoice%20Transaction/jump_related_order.xml new file mode 100644 index 0000000000000000000000000000000000000000..d161dc8724de46f4262a42fca6b3f5541ffa280c --- /dev/null +++ b/bt5/erp5_invoicing/ActionTemplateItem/portal_types/Sale%20Invoice%20Transaction/jump_related_order.xml @@ -0,0 +1,87 @@ +<?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>__ac_local_roles__</string> </key> + <value> + <none/> + </value> + </item> + <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_jump</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>jump_related_order</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>17.0</float> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string>Related Sale Order</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 encoding="cdata"><![CDATA[ + +string:${object_url}/Invoice_jumpToOrder?packing_list_type=Sale%20Packing%20List&order_type=Sale%20Order + +]]></string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/Invoice_jumpToOrder.xml b/bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/Invoice_jumpToOrder.xml new file mode 100644 index 0000000000000000000000000000000000000000..8ba745a013e4386f6730d287afbbf1e53572403a --- /dev/null +++ b/bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/Invoice_jumpToOrder.xml @@ -0,0 +1,208 @@ +<?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>Python_magic</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>Script_magic</string> </key> + <value> <int>3</int> </value> + </item> + <item> + <key> <string>__ac_local_roles__</string> </key> + <value> + <none/> + </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>"""Jump to the order(s) this invoice was created from.\n +"""\n +portal = context.getPortalObject()\n +translateString = portal.Base_translateString\n +packing_list_list = context.getCausalityValueList(portal_type=packing_list_type,\n + checked_permission=\'View\')\n +related_order_uid_list = []\n +if packing_list_list:\n + if len(packing_list_list) == 1:\n + related_order_list = packing_list_list[0].getCausalityValueList(\n + portal_type=order_type,\n + checked_permission=\'View\')\n + related_order_uid_list = [o.getUid() for o in related_order_list]\n + if len(related_order_list) == 1:\n + related_object = related_order_list[0]\n + message = translateString(\n + # first, try to get a full translated message with portal types\n + "%s related to %s." % (related_object.getPortalType(), context.getPortalType()),\n + # if not found, fallback to generic translation\n + default = unicode(translateString(\'${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() }), \'utf8\'))\n + return related_order_list[0].Base_redirect(\'view\',\n + keep_items=dict(portal_status_message=message))\n + else:\n + for packing_list in packing_list_list:\n + related_order_uid_list.extend(packing_list.getCausalityValueList(\n + portal_type=order_type,\n + checked_permission=\'View\'))\n +\n +if related_order_uid_list:\n + order_module = portal.getDefaultModule(order_type)\n + return order_module.Base_redirect(\'view\',\n + keep_items=dict(reset=1,\n + uid=related_order_uid_list))\n +\n +return context.Base_redirect(form_id,\n + keep_items=dict(portal_status_message=\n + translateString(\'No ${portal_type} Related.\',\n + mapping=dict(portal_type=order_type))))\n +</string> </value> + </item> + <item> + <key> <string>_code</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>_filepath</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>_owner</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>_params</string> </key> + <value> <string>packing_list_type, order_type, 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>3</int> </value> + </item> + <item> + <key> <string>co_varnames</string> </key> + <value> + <tuple> + <string>packing_list_type</string> + <string>order_type</string> + <string>form_id</string> + <string>_getattr_</string> + <string>context</string> + <string>portal</string> + <string>translateString</string> + <string>packing_list_list</string> + <string>related_order_uid_list</string> + <string>len</string> + <string>_getitem_</string> + <string>related_order_list</string> + <string>append</string> + <string>$append0</string> + <string>_getiter_</string> + <string>o</string> + <string>related_object</string> + <string>unicode</string> + <string>message</string> + <string>dict</string> + <string>packing_list</string> + <string>order_module</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>Invoice_jumpToOrder</string> </value> + </item> + <item> + <key> <string>warnings</string> </key> + <value> + <tuple/> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_invoicing/bt/revision b/bt5/erp5_invoicing/bt/revision index 6d58c4e590bdd76fbff00cfc9505eedd3cc90f32..97e35041104a8d82c502ddb40b240e68f392c0d1 100644 --- a/bt5/erp5_invoicing/bt/revision +++ b/bt5/erp5_invoicing/bt/revision @@ -1 +1 @@ -109 \ No newline at end of file +110 \ No newline at end of file diff --git a/bt5/erp5_invoicing/bt/template_action_path_list b/bt5/erp5_invoicing/bt/template_action_path_list index d05d8446fd1dd093a7cbfc52eb13e93c0cac62a7..36377733bc881e1a16f6312d9ac97f2c13ac2a37 100644 --- a/bt5/erp5_invoicing/bt/template_action_path_list +++ b/bt5/erp5_invoicing/bt/template_action_path_list @@ -5,6 +5,7 @@ Invoice Transaction Rule | divergence Invoice Transaction Rule | view Invoicing Rule | view Purchase Invoice Transaction | apply_trade_condition +Purchase Invoice Transaction | jump_related_order Purchase Invoice Transaction | jump_to_related_purchase_packing_list Purchase Invoice Transaction | trade_condition_profile_view Purchase Invoice Transaction | view_discount @@ -13,6 +14,7 @@ Purchase Invoice Transaction | view_tax Sale Invoice Transaction | apply_trade_condition Sale Invoice Transaction | invoice_item_list Sale Invoice Transaction | invoice_print +Sale Invoice Transaction | jump_related_order Sale Invoice Transaction | jump_to_related_sale_packing_list Sale Invoice Transaction | payment_condition Sale Invoice Transaction | trade_condition_profile_view