Commit 90c019e3 authored by Aurel's avatar Aurel

pay sheet model lines can vary on multiple base applications and generate

cell ranges which is a combination of different base application,
update asCellRange script for this case


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@41939 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f61a5080
...@@ -57,6 +57,21 @@ cell_range = []\n ...@@ -57,6 +57,21 @@ cell_range = []\n
if resource is not None:\n if resource is not None:\n
base_category_list = resource.getVariationBaseCategoryList()\n base_category_list = resource.getVariationBaseCategoryList()\n
for base_category in base_category_list:\n for base_category in base_category_list:\n
if base_category == "base_application":\n
base_application_variation_dict = {}\n
variation_list = context.getVariationCategoryList(base_category_list=(base_category,))\n
for variation in variation_list:\n
# We split at the sublevel of base_application/base_amount/payroll/XXX\n
base_variation = \'/\'.join(variation.split(\'/\')[:4])\n
base_application_variation_dict.setdefault(base_variation, []) \n
base_application_variation_dict[base_variation].append(variation)\n
\n
for v in base_application_variation_dict.values():\n
if matrixbox == 1:\n
cell_range.append(map(lambda x: (x[1],x[0]), v))\n
else:\n
cell_range.append(v)\n
else:\n
if matrixbox == 1:\n if matrixbox == 1:\n
# XXX matrixbox is right_display (not as listfield) => invert display and value in item\n # XXX matrixbox is right_display (not as listfield) => invert display and value in item\n
cell_range.append(map(lambda x: (x[1],x[0]), \n cell_range.append(map(lambda x: (x[1],x[0]), \n
......
...@@ -110,6 +110,18 @@ else:\n ...@@ -110,6 +110,18 @@ else:\n
variation_base_category_list = context.getVariationBaseCategoryList()\n variation_base_category_list = context.getVariationBaseCategoryList()\n
variation_base_category_list.sort()\n variation_base_category_list.sort()\n
for base_category in variation_base_category_list:\n for base_category in variation_base_category_list:\n
if base_category == "base_application":\n
base_application_variation_dict = {}\n
variation_list = context.getVariationCategoryList(base_category_list=(base_category,))\n
for variation in variation_list:\n
# We split at the sublevel of base_application/base_amount/payroll/XXX\n
base_variation = \'/\'.join(variation.split(\'/\')[:4])\n
base_application_variation_dict.setdefault(base_variation, []) \n
base_application_variation_dict[base_variation].append(variation)\n
\n
for v in base_application_variation_dict.values():\n
list_of_category_list.append(v)\n
else:\n
list_of_category_list.append(\\\n list_of_category_list.append(\\\n
context.getVariationCategoryList(base_category_list=base_category))\n context.getVariationCategoryList(base_category_list=base_category))\n
return list_of_category_list\n return list_of_category_list\n
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment