From 3ea6eda871db13bb3c64ca19a2f6cd7f835bc7a4 Mon Sep 17 00:00:00 2001 From: Vincent Pelletier <vincent@nexedi.com> Date: Tue, 20 Mar 2007 10:31:23 +0000 Subject: [PATCH] Check that resource is defined on the Account Incident. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13517 20353a03-c40f-0410-a6d1-a30d3c3de9de --- .../checkConsistencyAndValidatePositionAccounting.xml | 5 ++++- bt5/erp5_banking_cash/bt/revision | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/account_incident_workflow/scripts/checkConsistencyAndValidatePositionAccounting.xml b/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/account_incident_workflow/scripts/checkConsistencyAndValidatePositionAccounting.xml index bd03f4f5dd..8bdaebe0de 100644 --- a/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/account_incident_workflow/scripts/checkConsistencyAndValidatePositionAccounting.xml +++ b/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/account_incident_workflow/scripts/checkConsistencyAndValidatePositionAccounting.xml @@ -77,6 +77,9 @@ from Products.ERP5Type.Message import Message\n transaction = state_change[\'object\']\n date = transaction.getStartDate()\n \n +if transaction.getResourceValue() is None:\n + raise ValidationFailed, Message(domain="ui", message="No resource defined.")\n +\n user_id = transaction.portal_membership.getAuthenticatedMember().getUserName()\n site_list = context.Baobab_getUserAssignedSiteList(user_id=user_id)\n # context.log(\'validateVaultBalance site_list\',site_list)\n @@ -214,11 +217,11 @@ if debit:\n <string>transaction</string> <string>_getattr_</string> <string>date</string> + <string>None</string> <string>user_id</string> <string>context</string> <string>site_list</string> <string>source</string> - <string>None</string> <string>baobab_source</string> <string>_getiter_</string> <string>site</string> diff --git a/bt5/erp5_banking_cash/bt/revision b/bt5/erp5_banking_cash/bt/revision index 3960544522..c5a644422f 100644 --- a/bt5/erp5_banking_cash/bt/revision +++ b/bt5/erp5_banking_cash/bt/revision @@ -1 +1 @@ -220 \ No newline at end of file +221 \ No newline at end of file -- 2.30.9