Commit c331e012 authored by Jérome Perrin's avatar Jérome Perrin

PaySheetModelLine_asCellRange: Don't raise string exception; translate base category title

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@21389 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 05a14454
...@@ -80,15 +80,14 @@ def framing(cell, name):\n ...@@ -80,15 +80,14 @@ def framing(cell, name):\n
if cell is None:\n if cell is None:\n
# This error happens when the cell is not found in the parent model or any\n # This error happens when the cell is not found in the parent model or any\n
# inherited model.\n # inherited model.\n
raise "PaySheetModelLine_asCellRange Error", "cell is None for %s" % name\n raise ValueError, "PaySheetModelLine_asCellRange: cell is None for %s" % name\n
return \'%s <= %s < %s\' % (str(cell.getQuantityRangeMin()), name,\n return \'%s <= %s < %s\' % (str(cell.getQuantityRangeMin()), name,\n
str(cell.getQuantityRangeMax()))\n str(cell.getQuantityRangeMax()))\n
\n \n
\n \n
N_ = context.Base_translateString\n translateString = context.Base_translateString\n
resource = context.getResourceValue()\n resource = context.getResourceValue()\n
cell_range = []\n cell_range = []\n
tax_category_title = N_(\'(Amount or Percent)\')\n
\n \n
if matrixbox :\n if matrixbox :\n
if resource is not None:\n if resource is not None:\n
...@@ -104,9 +103,9 @@ if matrixbox :\n ...@@ -104,9 +103,9 @@ if matrixbox :\n
category_item[0])))\n category_item[0])))\n
elif base_category == \'tax_category\':\n elif base_category == \'tax_category\':\n
category_cell_range.append((category_item[1], \n category_cell_range.append((category_item[1], \n
\' \'.join((category_item[0], tax_category_title))))\n translateString(\'%s (Amount or Percent)\' % category_item[0])))\n
else:\n else:\n
raise "PaySheetModelLine_asCellRange Error", "the two categories "\\\n raise ValueError, "PaySheetModelLine_asCellRange: the two categories "\\\n
"must could be only tax_category and salary_range"\n "must could be only tax_category and salary_range"\n
cell_range.append(category_cell_range)\n cell_range.append(category_cell_range)\n
\n \n
...@@ -175,10 +174,9 @@ else:\n ...@@ -175,10 +174,9 @@ else:\n
<string>framing</string> <string>framing</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>N_</string> <string>translateString</string>
<string>resource</string> <string>resource</string>
<string>cell_range</string> <string>cell_range</string>
<string>tax_category_title</string>
<string>None</string> <string>None</string>
<string>base_category_list</string> <string>base_category_list</string>
<string>_getiter_</string> <string>_getiter_</string>
...@@ -187,6 +185,7 @@ else:\n ...@@ -187,6 +185,7 @@ else:\n
<string>category_item_list</string> <string>category_item_list</string>
<string>category_item</string> <string>category_item</string>
<string>_getitem_</string> <string>_getitem_</string>
<string>ValueError</string>
<string>filter</string> <string>filter</string>
<string>list_of_category_list</string> <string>list_of_category_list</string>
<string>variation_base_category_list</string> <string>variation_base_category_list</string>
......
249 250
\ No newline at end of file \ No newline at end of file
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