[Erp5-report] r18146 - in /erp5/trunk/bt5/erp5_accounting: WorkflowTemplateItem/portal_work...

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Dec 7 18:50:53 CET 2007


Author: jerome
Date: Fri Dec  7 18:50:53 2007
New Revision: 18146

URL: http://svn.erp5.org?rev=18146&view=rev
Log:
don't access context in worklfow script.

Modified:
    erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/validateBudget.xml
    erp5/trunk/bt5/erp5_accounting/bt/revision

Modified: erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/validateBudget.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/validateBudget.xml?rev=18146&r1=18145&r2=18146&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/validateBudget.xml (original)
+++ erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/validateBudget.xml Fri Dec  7 18:50:53 2007
@@ -71,6 +71,7 @@
 """ This scripts validate that this transaction fits in the defined budget. It requires erp5_budget.\n
 """\n
 transaction = state_change[\'object\']\n
+portal = state_change.getPortal()\n
 \n
 # checks if there is enough budget before validating this transaction\n
 AccountingTransaction_viewAccountingTransactionLineList = transaction.contentValues(\n
@@ -81,13 +82,13 @@
 \n
 # delete all objects which are mapped values (predicates) in the budget module\n
 id_list = []\n
-for objects in transaction.getObject().getPortalObject().budget_module.objectValues():\n
+for objects in portal.budget_module.objectValues():\n
   if objects.getPortalType() == \'Mapped Value\':\n
     id_list.append(objects.getId())\n
-context.budget_module.manage_delObjects(id_list)\n
+portal.budget_module.manage_delObjects(id_list)\n
 \n
 # Create predicates (mapped values) from budget cells\n
-for objects in transaction.getObject().getPortalObject().budget_module.objectValues():\n
+for objects in portal.budget_module.objectValues():\n
   if objects.getPortalType() == \'Budget\':\n
     for obj_line in objects.objectValues():\n
       if obj_line.getPortalType() == \'Budget Line\':\n
@@ -110,7 +111,7 @@
     new_id = \'atl\' + str(line.getId())\n
     financial_section = line.getSourceValue().getFinancialSectionValue().getCategoryRelativeUrl(base=0)\n
     function_category = line.getParent().getSourceFunction()\n
-    function = context.portal_categories.getCategoryValue(function_category).getCategoryRelativeUrl(base=0)\n
+    function = portal.portal_categories.getCategoryValue(function_category).getCategoryRelativeUrl(base=0)\n
     group = line.getParent().getSourceSectionValue().getGroup() \n
     quantity = -line.getQuantity()\n
     temp_obj = line.asContext(\n
@@ -129,7 +130,7 @@
     temp_obj.setGroup(group)\n
     temp_obj.setQuantity(quantity)\n
     enough_budget = 0\n
-    for objects in context.getPortalObject().budget_module.objectValues():\n
+    for objects in portal.budget_module.objectValues():\n
       if objects.getPortalType() == \'Mapped Value\': \n
          res = objects.test(temp_obj)\n
          if res: \n
@@ -193,11 +194,11 @@
                             <string>_getitem_</string>
                             <string>transaction</string>
                             <string>_getattr_</string>
+                            <string>portal</string>
                             <string>AccountingTransaction_viewAccountingTransactionLineList</string>
                             <string>id_list</string>
                             <string>_getiter_</string>
                             <string>objects</string>
-                            <string>context</string>
                             <string>obj_line</string>
                             <string>obj</string>
                             <string>financial_section</string>

Modified: erp5/trunk/bt5/erp5_accounting/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/bt/revision?rev=18146&r1=18145&r2=18146&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/bt/revision (original)
+++ erp5/trunk/bt5/erp5_accounting/bt/revision Fri Dec  7 18:50:53 2007
@@ -1,1 +1,1 @@
-522
+523




More information about the Erp5-report mailing list