From 7ac8c7d9e48f19015275a3dffb7ce4ce63108328 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Fri, 11 May 2007 13:29:03 +0000
Subject: [PATCH] When creating a reversal transaction for an existing
 transction, the new transaction will have the same causality as the voided
 transaction (+this transaction itself)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14466 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../AccountingTransaction_createReversalTransaction.xml     | 6 +++++-
 bt5/erp5_accounting/bt/revision                             | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_createReversalTransaction.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_createReversalTransaction.xml
index 00acd632fd..de56cd03dd 100644
--- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_createReversalTransaction.xml
+++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_createReversalTransaction.xml
@@ -79,6 +79,9 @@ if is_source:\n
 else:\n
   specific_reference = context.getDestinationReference()\n
 \n
+causality_value_list = context.getCausalityValueList()\n
+causality_value_list.append(context)\n
+\n
 reversal = accounting_module.newContent (\n
     portal_type=context.getPortalType(),\n
     source_section=context.getSourceSection(),\n
@@ -93,7 +96,7 @@ reversal = accounting_module.newContent (\n
                \'specific_reference\': specific_reference}),\n
     resource=context.getResource(),\n
     reference=context.getReference(),\n
-    causality_value=context,\n
+    causality_value_list=causality_value_list,\n
     created_by_builder=1 # XXX to prevent init script to create lines\n
   )\n
 \n
@@ -189,6 +192,7 @@ return context.REQUEST.RESPONSE.redirect("%s/view?portal_status_message=%s" %\n
                             <string>accounting_module</string>
                             <string>is_source</string>
                             <string>specific_reference</string>
+                            <string>causality_value_list</string>
                             <string>unicode</string>
                             <string>reversal</string>
                             <string>line_list</string>
diff --git a/bt5/erp5_accounting/bt/revision b/bt5/erp5_accounting/bt/revision
index f1efb20540..a540f59f28 100644
--- a/bt5/erp5_accounting/bt/revision
+++ b/bt5/erp5_accounting/bt/revision
@@ -1 +1 @@
-300
\ No newline at end of file
+301
\ No newline at end of file
-- 
2.30.9