From 934c53ac4bdabcdc882541c969a7afa8603b5391 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com> Date: Fri, 20 Feb 2009 10:14:55 +0000 Subject: [PATCH] when budget line or budget cell share a category variation with the budget, we show only subcategories of the budget category, and we include the budget category itself. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25633 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5/Document/CategoryBudgetVariation.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/product/ERP5/Document/CategoryBudgetVariation.py b/product/ERP5/Document/CategoryBudgetVariation.py index c43323e743..516f99b964 100644 --- a/product/ERP5/Document/CategoryBudgetVariation.py +++ b/product/ERP5/Document/CategoryBudgetVariation.py @@ -129,20 +129,22 @@ class CategoryBudgetVariation(BudgetVariation): 'preferred_category_child_item_list_method_id', 'getCategoryChildCompactLogicalPathItemList') - # If this category is defined on budget level, only show subcategories. + item_list_method_parameter_dict = dict( + base=1, + local_sort_id=('int_index', 'translated_title'), + checked_permission='View') + + # If this category is defined on budget level, starts at this level budget = budget_line.getParentValue() if base_category in budget.getVariationBaseCategoryList(): for budget_variation_category in budget.getVariationCategoryList(): if budget_variation_category.split('/')[0] == base_category: base_category = budget_variation_category + item_list_method_parameter_dict['is_self_excluded'] = False break return getattr(portal.portal_categories.unrestrictedTraverse(base_category), - item_list_method)( - base=1, - local_sort_id=('int_index', - 'translated_title'), - checked_permission='View') + item_list_method)(**item_list_method_parameter_dict) def initializeBudgetLine(self, budget_line): """Initialize a budget line -- 2.30.9