diff --git a/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckbookDelivery_checkAggregateStockList.xml b/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckbookDelivery_checkAggregateStockList.xml new file mode 100644 index 0000000000000000000000000000000000000000..b7b95ce7357b58905a85e8892331b5b5abdd86b3 --- /dev/null +++ b/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckbookDelivery_checkAggregateStockList.xml @@ -0,0 +1,174 @@ +<?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>current_tracking_list = [x.getObject() for x in context.portal_simulation.getCurrentTrackingList(\n + at_date=at_date, node=node_url,\n + where_expression="item_catalog.portal_type=\'Check\' or item_catalog.portal_type=\'Checkbook\'")]\n +aggregate_uid_list = [x.uid for x in current_tracking_list]\n +for line in context.getMovementList():\n + for aggregate_uid in line.getAggregateUidList():\n + if aggregate_uid not in aggregate_uid_list:\n + aggregate_value = context.portal_catalog(uid=aggregate_uid)[0].getObject()\n + msg = Message(domain="ui", message="Sorry, the item with reference $reference is not available any more",\n + mapping={\'reference\':aggregate_value.getReference()})\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>_owner</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>_params</string> </key> + <value> <string>node_url=None, at_date=None</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>2</int> </value> + </item> + <item> + <key> <string>co_varnames</string> </key> + <value> + <tuple> + <string>node_url</string> + <string>at_date</string> + <string>append</string> + <string>$append0</string> + <string>_getiter_</string> + <string>_getattr_</string> +<string>context</string> + <string>x</string> + <string>current_tracking_list</string> + <string>aggregate_uid_list</string> + <string>line</string> + <string>aggregate_uid</string> + <string>_getitem_</string> + <string>aggregate_value</string> + <string>Message</string> + <string>msg</string> + <string>ValidationFailed</string> + </tuple> + </value> + </item> + </dictionary> + </state> + </object> + </value> + </item> + <item> + <key> <string>func_defaults</string> </key> + <value> + <tuple> + <none/> + <none/> + </tuple> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>CheckbookDelivery_checkAggregateStockList</string> </value> + </item> + <item> + <key> <string>warnings</string> </key> + <value> + <tuple/> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/checkbook_usual_cash_transfer_workflow/scripts/validateCheckbookVaultTransferConsistency.xml b/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/checkbook_usual_cash_transfer_workflow/scripts/validateCheckbookVaultTransferConsistency.xml index 76ac05ddf8584ec24ed02c5f44676436a12ce35b..cfd50bcfe282973a2cf28550411e1bcb2857914b 100644 --- a/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/checkbook_usual_cash_transfer_workflow/scripts/validateCheckbookVaultTransferConsistency.xml +++ b/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/checkbook_usual_cash_transfer_workflow/scripts/validateCheckbookVaultTransferConsistency.xml @@ -83,15 +83,8 @@ if len(line_list)==0:\n msg = Message(domain="ui", message="Sorry, you must select at least one check or checkbook")\n \n baobab_source = transaction.getBaobabSource()\n -reference_date = transaction.getStartDate()\n -current_tracking_list = [x.getObject() for x in transaction.portal_simulation.getCurrentTrackingList(\n - at_date=reference_date, node=baobab_source,\n - where_expression="item_catalog.portal_type=\'Check\' or item_catalog.portal_type=\'Checkbook\'")]\n -aggregate_uid_list = [x.uid for x in current_tracking_list]\n -for line in transaction.getMovementList(portal_type=\'Checkbook Delivery Line\'):\n - for aggregate_uid in line.getAggregateUidList():\n - if aggregate_uid not in aggregate_uid_list:\n - msg = Message(domain="ui", message="Sorry, an item is not available any more")\n +at_date = transaction.getStartDate()\n +context.CheckbookDelivery_checkAggregateStockList(at_date=at_date, node_url = baobab_source)\n \n if msg is not None:\n raise ValidationFailed, (msg,)\n @@ -151,15 +144,8 @@ if msg is not None:\n <string>line_list</string> <string>len</string> <string>baobab_source</string> - <string>reference_date</string> - <string>append</string> - <string>$append0</string> - <string>_getiter_</string> - <string>x</string> - <string>current_tracking_list</string> - <string>aggregate_uid_list</string> - <string>line</string> - <string>aggregate_uid</string> + <string>at_date</string> + <string>context</string> </tuple> </value> </item> diff --git a/bt5/erp5_banking_check/bt/revision b/bt5/erp5_banking_check/bt/revision index aca544d017fda52bacd14eecff279d5097137c6e..4b9bce48238e62028651de99e7f2b218771cd806 100644 --- a/bt5/erp5_banking_check/bt/revision +++ b/bt5/erp5_banking_check/bt/revision @@ -1 +1 @@ -145 \ No newline at end of file +148 \ No newline at end of file