From 576c328333308df5439c4b5f595eb595b2be8e36 Mon Sep 17 00:00:00 2001 From: Fabien Morin <fabien@nexedi.com> Date: Thu, 15 Jan 2009 16:53:10 +0000 Subject: [PATCH] add a condition to return None if the slice is not found git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25134 20353a03-c40f-0410-a6d1-a30d3c3de9de --- ...PaySheetTransaction_getYearToDateSlice.xml | 24 ++++--------------- bt5/erp5_payroll_l10n_fr/bt/revision | 2 +- .../bt/template_path_list | 2 +- 3 files changed, 7 insertions(+), 21 deletions(-) diff --git a/bt5/erp5_payroll_l10n_fr/SkinTemplateItem/portal_skins/erp5_payroll_l10n_fr/PaySheetTransaction_getYearToDateSlice.xml b/bt5/erp5_payroll_l10n_fr/SkinTemplateItem/portal_skins/erp5_payroll_l10n_fr/PaySheetTransaction_getYearToDateSlice.xml index 00c6ba72d1..cae6aa6759 100644 --- a/bt5/erp5_payroll_l10n_fr/SkinTemplateItem/portal_skins/erp5_payroll_l10n_fr/PaySheetTransaction_getYearToDateSlice.xml +++ b/bt5/erp5_payroll_l10n_fr/SkinTemplateItem/portal_skins/erp5_payroll_l10n_fr/PaySheetTransaction_getYearToDateSlice.xml @@ -9,22 +9,10 @@ </pickle> <pickle> <dictionary> - <item> - <key> <string>Python_magic</string> </key> - <value> - <none/> - </value> - </item> <item> <key> <string>Script_magic</string> </key> <value> <int>3</int> </value> </item> - <item> - <key> <string>__ac_local_roles__</string> </key> - <value> - <none/> - </value> - </item> <item> <key> <string>_bind_names</string> </key> <value> @@ -93,6 +81,10 @@ yearly_slice_amount = 0\n # get the slice value for this paysheet :\n model = context.getSpecialiseValue()\n slice = model.getCell(slice_path)\n +\n +if not slice:\n + return None\n +\n plafond = slice.getQuantityRangeMax()\n \n gross_salary = context.PaySheetTransaction_getAmountFromBaseParticipationList(\\\n @@ -131,12 +123,6 @@ return yearly_slice_amount\n <none/> </value> </item> - <item> - <key> <string>_filepath</string> </key> - <value> - <none/> - </value> - </item> <item> <key> <string>_params</string> </key> <value> <string>slice_path</string> </value> @@ -179,13 +165,13 @@ return yearly_slice_amount\n <string>yearly_slice_amount</string> <string>model</string> <string>slice</string> + <string>None</string> <string>plafond</string> <string>gross_salary</string> <string>slice_amount</string> <string>_inplacevar_</string> <string>_getiter_</string> <string>paysheet</string> - <string>None</string> </tuple> </value> </item> diff --git a/bt5/erp5_payroll_l10n_fr/bt/revision b/bt5/erp5_payroll_l10n_fr/bt/revision index 8c0474e323..d7765fe47e 100644 --- a/bt5/erp5_payroll_l10n_fr/bt/revision +++ b/bt5/erp5_payroll_l10n_fr/bt/revision @@ -1 +1 @@ -69 \ No newline at end of file +70 \ No newline at end of file diff --git a/bt5/erp5_payroll_l10n_fr/bt/template_path_list b/bt5/erp5_payroll_l10n_fr/bt/template_path_list index 61fb588c10..f6acb72dce 100644 --- a/bt5/erp5_payroll_l10n_fr/bt/template_path_list +++ b/bt5/erp5_payroll_l10n_fr/bt/template_path_list @@ -3,4 +3,4 @@ portal_categories/salary_range/france/tranche_1 portal_categories/salary_range/france/tranche_2 portal_categories/salary_range/france/tranche_a portal_categories/salary_range/france/tranche_b -portal_categories/salary_range/france/tranche_c +portal_categories/salary_range/france/tranche_c \ No newline at end of file -- 2.30.9