From 15554b1fefed962a7816f77cbf9926cabd710255 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Wed, 1 Oct 2008 13:38:25 +0000
Subject: [PATCH] get group and region from the budget cell, not the budget
 line

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23936 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../erp5_budget/BudgetCell_getConsumedBudget.xml  | 15 ++++++---------
 .../erp5_budget/BudgetCell_getEngagedBudget.xml   |  8 ++++----
 bt5/erp5_budget/bt/revision                       |  2 +-
 3 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/bt5/erp5_budget/SkinTemplateItem/portal_skins/erp5_budget/BudgetCell_getConsumedBudget.xml b/bt5/erp5_budget/SkinTemplateItem/portal_skins/erp5_budget/BudgetCell_getConsumedBudget.xml
index 6a08acd5a1..68117c5a02 100644
--- a/bt5/erp5_budget/SkinTemplateItem/portal_skins/erp5_budget/BudgetCell_getConsumedBudget.xml
+++ b/bt5/erp5_budget/SkinTemplateItem/portal_skins/erp5_budget/BudgetCell_getConsumedBudget.xml
@@ -81,7 +81,7 @@ if parent.isMemberOf(\n
   kw[\'node_category\'] = parent.getFinancialSection(base=1)\n
 if parent.isMemberOf(\n
     \'budget_line_variation/budget_variation/node_category_budget_section\'):\n
-#  kw[\'stock.function_uid\'] = parent.getBudgetSectionUid() #(base=1)\n
+#  kw[\'stock.function_uid\'] = parent.getBudgetSectionUid()\n
   kw[\'node_category\'] = parent.getBudgetSection(base=1)\n
 \n
 # mirror node\n
@@ -95,32 +95,30 @@ if (context.isMemberOf(\n
     \'budget_cell_variation/budget_variation/section_category_group\') or\n
     context.isMemberOf(\n
       \'budget_line_variation/budget_variation/section_category_group\')):\n
-  kw[\'section_category\'] = parent.getGroup(base=1)\n
+  kw[\'section_category\'] = context.getGroup(base=1)\n
 elif (context.isMemberOf(\n
     \'budget_cell_variation/budget_variation/section_category_region\') or\n
     context.isMemberOf(\n
       \'budget_line_variation/budget_variation/section_category_region\')):\n
-  kw[\'section_category\'] = parent.getRegion(base=1)\n
+  kw[\'section_category\'] = context.getRegion(base=1)\n
 \n
 # mirror section category\n
 if (context.isMemberOf(\n
     \'budget_cell_variation/budget_variation/mirror_section_category_group\') or \n
     context.isMemberOf(\n
       \'budget_line_variation/budget_variation/mirror_section_category_group\')):\n
-  kw[\'mirror_section_category\'] = parent.getGroup(base=1)\n
+  kw[\'mirror_section_category\'] = context.getGroup(base=1)\n
 elif (context.isMemberOf(\n
     \'budget_cell_variation/budget_variation/mirror_section_category_region\') or \n
     context.isMemberOf(\n
       \'budget_line_variation/budget_variation/mirror_section_category_region\')):\n
-  kw[\'mirror_section_category\'] = parent.getRegion(base=1)\n
-\n
+  kw[\'mirror_section_category\'] = context.getRegion(base=1)\n
 \n
 \n
 # FIXME: this should be configured on the budget domain\n
 #kw[\'node_category\'] = (\'account_type/asset\', \'account_type/expense\')\n
 \n
 \n
-\n
 if (parent.isMemberOf(\'budget_cell_variation/budget_variation/budget_line_type\')):\n
   if parent.getBudgetLineType() == \'expense\':\n
     kw[\'portal_type\'] = [\'Purchase Invoice Transaction Line\', \'Invoice Line\']\n
@@ -128,8 +126,7 @@ if (parent.isMemberOf(\'budget_cell_variation/budget_variation/budget_line_type\
     kw[\'portal_type\'] = [\'Sale Invoice Transaction Line\', \'Invoice Line\']\n
     return -context.portal_simulation.getInventoryAssetPrice(**kw)\n
 \n
-\n
-return context.portal_simulation.getInventory(**kw)\n
+return context.portal_simulation.getInventoryAssetPrice(**kw)\n
 </string> </value>
         </item>
         <item>
diff --git a/bt5/erp5_budget/SkinTemplateItem/portal_skins/erp5_budget/BudgetCell_getEngagedBudget.xml b/bt5/erp5_budget/SkinTemplateItem/portal_skins/erp5_budget/BudgetCell_getEngagedBudget.xml
index 57c73254fb..c155c36521 100644
--- a/bt5/erp5_budget/SkinTemplateItem/portal_skins/erp5_budget/BudgetCell_getEngagedBudget.xml
+++ b/bt5/erp5_budget/SkinTemplateItem/portal_skins/erp5_budget/BudgetCell_getEngagedBudget.xml
@@ -96,24 +96,24 @@ if (context.isMemberOf(\n
     \'budget_cell_variation/budget_variation/section_category_group\') or\n
     context.isMemberOf(\n
       \'budget_line_variation/budget_variation/section_category_group\')):\n
-  kw[\'section_category\'] = parent.getGroup(base=1)\n
+  kw[\'section_category\'] = context.getGroup(base=1)\n
 elif (context.isMemberOf(\n
     \'budget_cell_variation/budget_variation/section_category_region\') or\n
     context.isMemberOf(\n
       \'budget_line_variation/budget_variation/section_category_region\')):\n
-  kw[\'section_category\'] = parent.getRegion(base=1)\n
+  kw[\'section_category\'] = context.getRegion(base=1)\n
 \n
 # mirror section category\n
 if (context.isMemberOf(\n
     \'budget_cell_variation/budget_variation/mirror_section_category_group\') or \n
     context.isMemberOf(\n
       \'budget_line_variation/budget_variation/mirror_section_category_group\')):\n
-  kw[\'mirror_section_category\'] = parent.getGroup(base=1)\n
+  kw[\'mirror_section_category\'] = context.getGroup(base=1)\n
 elif (context.isMemberOf(\n
     \'budget_cell_variation/budget_variation/mirror_section_category_region\') or \n
     context.isMemberOf(\n
       \'budget_line_variation/budget_variation/mirror_section_category_region\')):\n
-  kw[\'mirror_section_category\'] = parent.getRegion(base=1)\n
+  kw[\'mirror_section_category\'] = context.getRegion(base=1)\n
 \n
 \n
 if (parent.isMemberOf(\'budget_cell_variation/budget_variation/budget_line_type\')):\n
diff --git a/bt5/erp5_budget/bt/revision b/bt5/erp5_budget/bt/revision
index 59f3135037..2efea5198b 100644
--- a/bt5/erp5_budget/bt/revision
+++ b/bt5/erp5_budget/bt/revision
@@ -1 +1 @@
-165
\ No newline at end of file
+167
\ No newline at end of file
-- 
2.30.9