From 5aa5642a440fad514dda34b4e1edc6ed2cbc01ce Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Fri, 27 Nov 2009 14:06:25 +0000
Subject: [PATCH] use proper tag / after tags for automatic grouping /
 ungrouping This fixes random failures of
 test_automatically_setting_grouping_reference_same_group and
 test_automatically_unsetting_grouping_reference_when_cancelling

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@30886 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../AccountingTransaction_guessGroupedLines.xml            | 1 +
 .../accounting_workflow/scripts/resetGroupingReference.xml | 7 +++----
 bt5/erp5_accounting/bt/revision                            | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_guessGroupedLines.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_guessGroupedLines.xml
index ccef4a94bc..84741277a3 100644
--- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_guessGroupedLines.xml
+++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_guessGroupedLines.xml
@@ -155,6 +155,7 @@ for (node, section, mirror_section), line_info_list in lines_per_node.items():\n
     for line in line_info_list:\n
       line_obj = portal.restrictedTraverse(line[\'path\'])\n
       line_obj.setGroupingReference(string_reference)\n
+      line_obj.reindexObject(activate_kw=dict(tag=\'accounting_grouping_reference\'))\n
       changed_lines.append(line[\'path\'])\n
 \n
 return changed_lines\n
diff --git a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/resetGroupingReference.xml b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/resetGroupingReference.xml
index ff24dd3183..9c816f270e 100644
--- a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/resetGroupingReference.xml
+++ b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/resetGroupingReference.xml
@@ -59,10 +59,9 @@ transaction = sci[\'object\']\n
 for line in transaction.getMovementList(\n
    portal_type=sci.getPortal().getPortalAccountingMovementTypeList()):\n
   if line.getGroupingReference():\n
-    line.activate(after_path_and_method_id=(\n
-                  (transaction.getPath(), (\'recursiveImmediateReindexObject\', \'immediateReindexObject\')),\n
-                  (line.getPath(), (\'recursiveImmediateReindexObject\', \'immediateReindexObject\')),),\n
-    ).AccountingTransactionLine_resetGroupingReference()\n
+    line.activate(\n
+       after_tag=\'accounting_grouping_reference\'\n
+       ).AccountingTransactionLine_resetGroupingReference()\n
 </string> </value>
         </item>
         <item>
diff --git a/bt5/erp5_accounting/bt/revision b/bt5/erp5_accounting/bt/revision
index 1286216edf..f3cd427b0f 100644
--- a/bt5/erp5_accounting/bt/revision
+++ b/bt5/erp5_accounting/bt/revision
@@ -1 +1 @@
-1067
\ No newline at end of file
+1069
\ No newline at end of file
-- 
2.30.9