From 61e52ed0b6ea1924868aa7e4c5c2221085394474 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aur=C3=A9lien=20Calonne?= <aurel@nexedi.com>
Date: Mon, 10 Jan 2011 14:25:46 +0000
Subject: [PATCH] update script which is now uses on trade model path instead
 of accounting rule cell

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42165 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 ...evisionForEmployeeSharePaySheetMovement.xml | 18 +++++++++++++++---
 bt5/erp5_payroll/bt/revision                   |  2 +-
 2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/SimulationMovement_generatePrevisionForEmployeeSharePaySheetMovement.xml b/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/SimulationMovement_generatePrevisionForEmployeeSharePaySheetMovement.xml
index 40c7c45bbc..7d014537fa 100644
--- a/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/SimulationMovement_generatePrevisionForEmployeeSharePaySheetMovement.xml
+++ b/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/SimulationMovement_generatePrevisionForEmployeeSharePaySheetMovement.xml
@@ -50,13 +50,25 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>property_dict[\'source_section\'] = context.getDestination()\n
-return property_dict\n
+            <value> <string>category_list = []\n
+for base_category in context.getSourceArrowBaseCategoryList():\n
+  if base_category == "source_section":\n
+    category = "source_section/"+movement.getDefaultAcquiredCategoryMembership("destination", base=0)\n
+  else:\n
+    category = context.getDefaultAcquiredCategoryMembership(base_category, base=1) # This should be moved to degault implementation of business path - XXX-JPS\n
+  \n
+  if category is None:\n
+    category = movement.getDefaultAcquiredCategoryMembership(base_category, base=1)\n
+\n
+  if category:\n
+    category_list.append(category)\n
+\n
+return category_list\n
 </string> </value>
         </item>
         <item>
             <key> <string>_params</string> </key>
-            <value> <string>property_dict</string> </value>
+            <value> <string>movement</string> </value>
         </item>
         <item>
             <key> <string>id</string> </key>
diff --git a/bt5/erp5_payroll/bt/revision b/bt5/erp5_payroll/bt/revision
index db08d2acf8..bb7a7c1b1a 100644
--- a/bt5/erp5_payroll/bt/revision
+++ b/bt5/erp5_payroll/bt/revision
@@ -1 +1 @@
-575
+576
-- 
2.30.9