From f3c4b720788387d0898e994c611256b6fce884d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Nowak?= <luke@nexedi.com> Date: Wed, 17 Jun 2009 09:34:02 +0000 Subject: [PATCH] - implement totally basic filtering git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27629 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5/Document/BusinessPath.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/product/ERP5/Document/BusinessPath.py b/product/ERP5/Document/BusinessPath.py index 43b8f6cc0d..f664c09356 100644 --- a/product/ERP5/Document/BusinessPath.py +++ b/product/ERP5/Document/BusinessPath.py @@ -144,7 +144,18 @@ class BusinessPath(Path): XXX - implementation missing TBD - look at CategoryTool._buildFilter for inspiration """ - return category_list + filtered_category_list = [] + for cat in category_list: + # basic filtering, dirty way: + # - remove categories, which are not defined in category parameter + # - support base parameter + base_cat, base_value = cat.split('/')[0] , '/'.join(cat.split('/')[1:]) + if base_cat == category: + value = base_value + if base == 1: + value = '/'.join([base_cat, value]) + filtered_category_list.append(value) + return filtered_category_list # Dynamic context based categories def _getDynamicCategoryList(self, context): -- 2.30.9