diff --git a/bt5/erp5_banking_cash/ActionTemplateItem/portal_types/Incident/in_input.xml b/bt5/erp5_banking_cash/ActionTemplateItem/portal_types/Incident/in_input.xml index 105e37c7ec388f32b8e5bca3e310a29ba66d7050..bbcb2e6e76addcec9ea365c03a0de4506d2578ee 100644 --- a/bt5/erp5_banking_cash/ActionTemplateItem/portal_types/Incident/in_input.xml +++ b/bt5/erp5_banking_cash/ActionTemplateItem/portal_types/Incident/in_input.xml @@ -27,7 +27,9 @@ </item> <item> <key> <string>condition</string> </key> - <value> <string></string> </value> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> + </value> </item> <item> <key> <string>description</string> </key> @@ -36,7 +38,7 @@ <item> <key> <string>icon</string> </key> <value> - <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> + <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent> </value> </item> <item> @@ -83,6 +85,22 @@ </pickle> </record> <record id="3" aka="AAAAAAAAAAM="> + <pickle> + <tuple> + <global name="Expression" module="Products.CMFCore.Expression"/> + <tuple/> + </tuple> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>text</string> </key> + <value> <string>python: here.getSimulationState() == "ordered"</string> </value> + </item> + </dictionary> + </pickle> + </record> + <record id="4" aka="AAAAAAAAAAQ="> <pickle> <tuple> <global name="Expression" module="Products.CMFCore.Expression"/> diff --git a/bt5/erp5_banking_cash/ActionTemplateItem/portal_types/Incident/out_input.xml b/bt5/erp5_banking_cash/ActionTemplateItem/portal_types/Incident/out_input.xml index f44c864c4b694c744179385a6014d70c706df919..96770d04aef73b6b2609c9b4b322b47937da08ee 100644 --- a/bt5/erp5_banking_cash/ActionTemplateItem/portal_types/Incident/out_input.xml +++ b/bt5/erp5_banking_cash/ActionTemplateItem/portal_types/Incident/out_input.xml @@ -27,7 +27,9 @@ </item> <item> <key> <string>condition</string> </key> - <value> <string></string> </value> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> + </value> </item> <item> <key> <string>description</string> </key> @@ -36,7 +38,7 @@ <item> <key> <string>icon</string> </key> <value> - <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> + <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent> </value> </item> <item> @@ -83,6 +85,22 @@ </pickle> </record> <record id="3" aka="AAAAAAAAAAM="> + <pickle> + <tuple> + <global name="Expression" module="Products.CMFCore.Expression"/> + <tuple/> + </tuple> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>text</string> </key> + <value> <string>python: here.getSimulationState() == "ordered"</string> </value> + </item> + </dictionary> + </pickle> + </record> + <record id="4" aka="AAAAAAAAAAQ="> <pickle> <tuple> <global name="Expression" module="Products.CMFCore.Expression"/> diff --git a/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/Incident_viewOutgoingLineFastInputDialog.xml b/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/Incident_viewOutgoingLineFastInputDialog.xml index 089039c5b1b170254a6e46c10690f9dccbdf7d71..dd8af2cbe25c5695e44a691ac718bdb33d31cfa8 100644 --- a/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/Incident_viewOutgoingLineFastInputDialog.xml +++ b/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/Incident_viewOutgoingLineFastInputDialog.xml @@ -76,7 +76,7 @@ if currency is None :\n \n cash_detail_dict = {\'line_portal_type\' : \'Outgoing Incident Line\'\n , \'operation_currency\' : currency\n - , \'cash_status_list\' : [\'valid\',\'new_emitted\']\n + , \'cash_status_list\' : [\'valid\',\'new_emitted\', \'not_defined\']\n , \'emission_letter_list\' : None\n , \'variation_list\' : context.Baobab_getResourceVintageList(banknote=1, coin=1)\n , \'currency_cash_portal_type\': None\n diff --git a/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/incident_workflow/scripts/checkBankAccountForInterface.xml b/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/incident_workflow/scripts/checkBankAccountForInterface.xml new file mode 100644 index 0000000000000000000000000000000000000000..0473ccd0144915de2dab5b02a8d4399da875f744 --- /dev/null +++ b/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/incident_workflow/scripts/checkBankAccountForInterface.xml @@ -0,0 +1,155 @@ +<?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>from Products.DCWorkflow.DCWorkflow import ValidationFailed\n +from Products.ERP5Type.Message import Message\n +\n +transaction = state_change[\'object\']\n +\n +\n +if transaction.getDestinationPaymentValue().getBicCode(\'\') == \'\':\n + msg = Message(domain = "ui", message="Bank account can\'t be used with interface.")\n + raise ValidationFailed, (msg,)\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>_params</string> </key> + <value> <string>state_change</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>state_change</string> + <string>Products.DCWorkflow.DCWorkflow</string> + <string>ValidationFailed</string> + <string>Products.ERP5Type.Message</string> + <string>Message</string> + <string>_getitem_</string> + <string>transaction</string> + <string>_getattr_</string> + <string>msg</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>checkBankAccountForInterface</string> </value> + </item> + <item> + <key> <string>warnings</string> </key> + <value> + <tuple/> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/incident_workflow/scripts/sendRequestToInterface.xml b/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/incident_workflow/scripts/sendRequestToInterface.xml new file mode 100644 index 0000000000000000000000000000000000000000..0e323b70521e5c4e72d66417b793353886701260 --- /dev/null +++ b/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/incident_workflow/scripts/sendRequestToInterface.xml @@ -0,0 +1,166 @@ +<?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>from Products.DCWorkflow.DCWorkflow import ValidationFailed\n +from Products.ERP5Type.Message import Message\n +\n +transaction = state_change[\'object\']\n +\n +obj=transaction\n +line=transaction[\'movement\']\n +if line.getPortalType() != "Banking Operation Line":\n + msg = Message(domain = "ui", message="Document is misconfigure, report it to administrator.")\n + raise ValidationFailed, (msg,)\n +\n +# send request to interface\n +d = context.STAR_initXMLTag()\n +context.STAR_generateOutgoingXMLHeader(obj, d)\n +context.STAR_generateMT202Block4(obj, line, d, source=1)\n +context.STAR_generateXMLMessage(obj, d)\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>_params</string> </key> + <value> <string>state_change</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>state_change</string> + <string>Products.DCWorkflow.DCWorkflow</string> + <string>ValidationFailed</string> + <string>Products.ERP5Type.Message</string> + <string>Message</string> + <string>_getitem_</string> + <string>transaction</string> + <string>obj</string> + <string>line</string> + <string>_getattr_</string> + <string>msg</string> + <string>context</string> + <string>d</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>sendRequestToInterface</string> </value> + </item> + <item> + <key> <string>warnings</string> </key> + <value> + <tuple/> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/incident_workflow/transitions/confirm.xml b/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/incident_workflow/transitions/confirm.xml index 978a78ff2bd9143df334dd67e6b63439a4c40684..41419a4feaf29ec2eb7f724a41bc77db52bcca5d 100644 --- a/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/incident_workflow/transitions/confirm.xml +++ b/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/incident_workflow/transitions/confirm.xml @@ -51,7 +51,7 @@ </item> <item> <key> <string>script_name</string> </key> - <value> <string></string> </value> + <value> <string>checkBankAccountForInterface</string> </value> </item> <item> <key> <string>title</string> </key> diff --git a/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/incident_workflow/transitions/stop.xml b/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/incident_workflow/transitions/stop.xml index f20840e01595fa14d81b2d18a0511c53440c8d05..4b8cc652dfeaa11485565783ad552dfb6a6ca04e 100644 --- a/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/incident_workflow/transitions/stop.xml +++ b/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/incident_workflow/transitions/stop.xml @@ -51,7 +51,7 @@ </item> <item> <key> <string>script_name</string> </key> - <value> <string></string> </value> + <value> <string>sendRequestToInterface</string> </value> </item> <item> <key> <string>title</string> </key> diff --git a/bt5/erp5_banking_cash/bt/revision b/bt5/erp5_banking_cash/bt/revision index 6b3ed8d68b037971d3b708a8060117ea8b6afbac..50b04dff0ea766f7fa6d8487eec7ff0a9a3611b8 100644 --- a/bt5/erp5_banking_cash/bt/revision +++ b/bt5/erp5_banking_cash/bt/revision @@ -1 +1 @@ -400 \ No newline at end of file +402 \ No newline at end of file