[Erp5-report] r42342 jerome - in /erp5/trunk/bt5/erp5_accounting: WorkflowTemplateItem/port...

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Jan 14 14:48:08 CET 2011


Author: jerome
Date: Fri Jan 14 14:48:08 2011
New Revision: 42342

URL: http://svn.erp5.org?rev=42342&view=rev
Log:
use the same code to get section uids as in the script to create balance
transaction (temp implementation)

Modified:
    erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/scripts/checkTransactionsState.xml
    erp5/trunk/bt5/erp5_accounting/bt/revision

Modified: erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/scripts/checkTransactionsState.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/scripts/checkTransactionsState.xml?rev=42342&r1=42341&r2=42342&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/scripts/checkTransactionsState.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/scripts/checkTransactionsState.xml [utf8] Fri Jan 14 14:48:08 2011
@@ -72,7 +72,37 @@ section_category = section.getGroup(base
 if not section_category:\n
   raise ValidationFailed, translateString("This Organisation must be member of a Group")\n
 \n
-section_uid = portal.Base_getSectionUidListForSectionCategory(section_category)\n
+\n
+# XXX copy and paste from AccountingPeriod_createBalanceTransaction !\n
+def isIndenpendantSection(section):\n
+  for ap in section.contentValues(\n
+              portal_type=\'Accounting Period\',\n
+              checked_permission=\'View\'):\n
+    if ap.getSimulationState() in (\'started\', \'stopped\', \'delivered\'):\n
+      return True\n
+  return False\n
+\n
+def getDependantSectionList(group, main_section):\n
+  section_list = []\n
+  recurse = True\n
+  for section in group.getGroupRelatedValueList(\n
+                            portal_type=\'Organisation\',\n
+                            strict_membership=True,\n
+                            checked_permission=\'View\'):\n
+    if section != main_section:\n
+      if isIndenpendantSection(section):\n
+        recurse = False\n
+      else:\n
+        section_list.append(section)\n
+  if recurse:\n
+    for subgroup in group.contentValues():\n
+      section_list.extend(getDependantSectionList(subgroup, main_section))\n
+\n
+  return section_list\n
+# /XXX\n
+\n
+section_uid = [section.getUid()] + [x.getUid() for x in getDependantSectionList(section.getGroupValue(), section)]\n
+\n
 \n
 movement_list = portal.portal_simulation.getMovementHistoryList(\n
       section_uid=section_uid,\n

Modified: erp5/trunk/bt5/erp5_accounting/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/bt/revision?rev=42342&r1=42341&r2=42342&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_accounting/bt/revision [utf8] Fri Jan 14 14:48:08 2011
@@ -1 +1 @@
-1431
\ No newline at end of file
+1432
\ No newline at end of file



More information about the Erp5-report mailing list