From 1da4a6dc8d495adf86f4b62744a1b47aabc1e59b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Tue, 24 Nov 2009 17:12:45 +0000
Subject: [PATCH] specify missing tags / after tags

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@30852 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../scripts/Delivery_Build.xml                | 38 +++++++++++--------
 .../scripts/buildTradeModelLineList.xml       |  8 ++--
 bt5/erp5_accounting/bt/revision               |  2 +-
 3 files changed, 29 insertions(+), 19 deletions(-)

diff --git a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/Delivery_Build.xml b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/Delivery_Build.xml
index f325af0c51..1683e8399c 100644
--- a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/Delivery_Build.xml
+++ b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/Delivery_Build.xml
@@ -104,9 +104,6 @@ if builder_by_ptype.has_key(delivery_portal_type) :\n
 \n
 \n
   # build accounting lines\n
-  method_id_list = (\'expand\', \'edit\', \'updateAppliedRule\', \'Delivery_updateAppliedRule\',\n
-                    \'immediateReindexObject\', \'recursiveImmediateReindexObject\')\n
-\n
   explanation_uid_list = [delivery.getUid(), ]\n
   packing_list = delivery.getCausalityValue(\n
                              portal_type=(\'Sale Packing List\',\n
@@ -119,24 +116,34 @@ if builder_by_ptype.has_key(delivery_portal_type) :\n
     if order is not None:\n
       explanation_uid_list.append(order.getUid())\n
 \n
-\n
-  tag = \'invoice_transaction_build_%s\' % delivery.getRelativeUrl()\n
+  build_trade_model_tag = \'invoice_transaction_build_trade_model_%s\' % \\\n
+                                 delivery.getRelativeUrl()\n
+  build_accounting_tag = \'invoice_transaction_build_accounting_%s\' % delivery.getRelativeUrl()\n
+  update_applied_rule_tag = \'%s_updateAppliedRule\' % delivery.getPath()\n
   builder.activate(\n
       activity=\'SQLQueue\',\n
-      after_path_and_method_id=(delivery.getPath(), method_id_list),\n
-      after_tag=delivery.getPath() + \'_updateAppliedRule\',\n
-      tag=tag,\n
-      activate_kw=dict(tag=tag)).build(activate_kw=dict(tag=tag),\n
-                                       explanation_uid=explanation_uid_list)\n
+      after_tag=(update_applied_rule_tag,\n
+                 build_trade_model_tag,),\n
+      tag=build_accounting_tag,\n
+      activate_kw=dict(tag=build_accounting_tag)).build(\n
+                      activate_kw=dict(tag=build_accounting_tag),\n
+                      explanation_uid=explanation_uid_list)\n
 \n
   # build related payment transactions\n
   portal_deliveries.payment_transaction_builder.activate(\n
-                              activity=\'SQLQueue\',\n
-                              after_method_id=method_id_list).build(explanation_uid=explanation_uid_list)\n
+                      activity=\'SQLQueue\',\n
+                      after_tag=( build_trade_model_tag,\n
+                                  update_applied_rule_tag,\n
+                                  build_accounting_tag, ),\n
+                      ).build(\n
+                          explanation_uid=explanation_uid_list)\n
 \n
   # set the object in building state.\n
   delivery.startBuilding()\n
-  delivery.activate(after_tag=tag).updateCausalityState()\n
+  delivery.activate(after_tag=(\n
+                      build_trade_model_tag,\n
+                      build_accounting_tag,)\n
+                      ).updateCausalityState()\n
 </string> </value>
         </item>
         <item>
@@ -190,11 +197,12 @@ if builder_by_ptype.has_key(delivery_portal_type) :\n
                             <string>previous_tag</string>
                             <string>expand_tag</string>
                             <string>activate_kw</string>
-                            <string>method_id_list</string>
                             <string>explanation_uid_list</string>
                             <string>packing_list</string>
                             <string>order</string>
-                            <string>tag</string>
+                            <string>build_trade_model_tag</string>
+                            <string>build_accounting_tag</string>
+                            <string>update_applied_rule_tag</string>
                             <string>dict</string>
                           </tuple>
                         </value>
diff --git a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/buildTradeModelLineList.xml b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/buildTradeModelLineList.xml
index f36ac3e955..27057c65e6 100644
--- a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/buildTradeModelLineList.xml
+++ b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/buildTradeModelLineList.xml
@@ -71,8 +71,9 @@ builder = getattr(portal_deliveries,\n
                   builder_by_portal_type[delivery_portal_type],\n
                   None)\n
 \n
-update_applied_rule_tag = \'invoice_update_applied_rule_%s\' % delivery.getRelativeUrl()\n
+update_applied_rule_tag = \'%s_updateAppliedRule\' % delivery.getPath()\n
 build_tag = \'invoice_transaction_build_trade_model_%s\' % delivery.getRelativeUrl()\n
+build_accounting_tag = \'invoice_transaction_build_accounting_%s\' % delivery.getRelativeUrl()\n
 \n
 delivery.Delivery_updateAppliedRule(activate_kw=dict(tag=update_applied_rule_tag))\n
 \n
@@ -94,11 +95,11 @@ if builder is not None:\n
       after_tag=update_applied_rule_tag,\n
       tag=build_tag,\n
       activate_kw=dict(tag=build_tag)).build(activate_kw=dict(tag=build_tag),\n
-                                        explanation_uid=explanation_uid_list)\n
+                                             explanation_uid=explanation_uid_list)\n
 \n
   # set the object in building state.\n
   delivery.startBuilding()\n
-  delivery.activate(after_tag=build_tag).updateCausalityState()\n
+  delivery.activate(after_tag=(build_tag, build_accounting_tag)).updateCausalityState()\n
 </string> </value>
         </item>
         <item>
@@ -147,6 +148,7 @@ if builder is not None:\n
                             <string>builder</string>
                             <string>update_applied_rule_tag</string>
                             <string>build_tag</string>
+                            <string>build_accounting_tag</string>
                             <string>dict</string>
                             <string>explanation_uid_list</string>
                             <string>packing_list</string>
diff --git a/bt5/erp5_accounting/bt/revision b/bt5/erp5_accounting/bt/revision
index 45bcd720f6..c9d864be1c 100644
--- a/bt5/erp5_accounting/bt/revision
+++ b/bt5/erp5_accounting/bt/revision
@@ -1 +1 @@
-1061
\ No newline at end of file
+1066
\ No newline at end of file
-- 
2.30.9