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

simplify script

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19716 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3b228a16
...@@ -73,49 +73,35 @@ ...@@ -73,49 +73,35 @@
"""\n """\n
paysheet = context.getObject()\n paysheet = context.getObject()\n
paysheet_type = paysheet.getPortalType()\n paysheet_type = paysheet.getPortalType()\n
#employee = paysheet.getDestinationSection()\n
#employer = paysheet.getSourceSection()\n
\n
#now source and section are resversed\n
employer = paysheet.getDestinationSection()\n employer = paysheet.getDestinationSection()\n
employee = paysheet.getSourceSection()\n employee = paysheet.getSourceSection()\n
\n \n
N_ = context.Base_translateString\n
\n \n
#if paysheet.getGrossSalary() == None:\n def redirect(msg):\n
# return context.REQUEST.RESPONSE.redirect(context.absolute_url() + \'?portal_status_message=Gross+salary+is+required\')\n return context.Base_redirect(form_id,\n
\n keep_items=dict(portal_status_message=N_(msg)))\n
if paysheet.getPriceCurrency() == None:\n
return context.REQUEST.RESPONSE.redirect(context.absolute_url() + \'?portal_status_message=Currency+is+required\')\n
\n \n
if paysheet.getStartDate() == None:\n if not paysheet.getPriceCurrency():\n
return context.REQUEST.RESPONSE.redirect(context.absolute_url() + \'?portal_status_message=Start+date+is+required\')\n return redirect(\'Currency is required\')\n
\n \n
if employee in (\'\', None):\n if not paysheet.getStartDate():\n
return context.REQUEST.RESPONSE.redirect(context.absolute_url() + \'?portal_status_message=The+employee+is+required\')\n return redirect(\'Date is required\')\n
\n \n
if employer in (\'\', None):\n if not employee:\n
return context.REQUEST.RESPONSE.redirect(context.absolute_url() + \'?portal_status_message=The+employer+is+required\')\n return redirect(\'The employee is required\')\n
\n \n
#employee_obj = paysheet.getDestinationSectionValue()\n if not employer:\n
#employer_obj = paysheet.getSourceSectionValue()\n return redirect(\'The employer is required\')\n
\n \n
#now source and section are resversed\n
employer_obj = paysheet.getDestinationSectionValue()\n employer_obj = paysheet.getDestinationSectionValue()\n
employee_obj = paysheet.getSourceSectionValue()\n employee_obj = paysheet.getSourceSectionValue()\n
\n \n
if not employee_obj.getCareerGrade():\n
return redirect(\'The employee must have a career grade\')\n
\n \n
if employee_obj.getCareerGrade() in (\'\', None):\n if not employee_obj.getMaritalStatusId():\n
return context.REQUEST.RESPONSE.redirect(context.absolute_url() + \'?portal_status_message=The+employee+must+have+a+career+grade\')\n return redirect(\'The employee must have a marital status\')\n
\n
if employee_obj.getMaritalStatusId() in (\'\', None):\n
return context.REQUEST.RESPONSE.redirect(context.absolute_url() + \'?portal_status_message=The+employee+must+have+a+marital+status\')\n
\n
if employer_obj.getCreationDate() in (\'\', None):\n
return context.REQUEST.RESPONSE.redirect(context.absolute_url() + \'?portal_status_message=The+employer+must+have+an+organisation+creation+date\')\n
\n
default_address = employer_obj.getDefaultAddress()\n
if default_address in (\'\', None) or default_address.getZipCode() in (\'\', None):\n
return context.REQUEST.RESPONSE.redirect(context.absolute_url() + \'?portal_status_message=The+employer+must+have+a+zip+code\')\n
\n \n
# parameters are OK, go to the pre-calculation form\n # parameters are OK, go to the pre-calculation form\n
return context.REQUEST.RESPONSE.redirect(context.absolute_url() + "/PaySheetTransaction_viewPreview?selection_name=default&dialog_category=object_action&form_id=PaySheetTransaction_view")\n return context.REQUEST.RESPONSE.redirect(context.absolute_url() + "/PaySheetTransaction_viewPreview?selection_name=default&dialog_category=object_action&form_id=PaySheetTransaction_view")\n
...@@ -143,7 +129,7 @@ return context.REQUEST.RESPONSE.redirect(context.absolute_url() + "/PaySheetTran ...@@ -143,7 +129,7 @@ return context.REQUEST.RESPONSE.redirect(context.absolute_url() + "/PaySheetTran
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string></string> </value> <value> <string>form_id=\'view\', **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -163,22 +149,24 @@ return context.REQUEST.RESPONSE.redirect(context.absolute_url() + "/PaySheetTran ...@@ -163,22 +149,24 @@ return context.REQUEST.RESPONSE.redirect(context.absolute_url() + "/PaySheetTran
<dictionary> <dictionary>
<item> <item>
<key> <string>co_argcount</string> </key> <key> <string>co_argcount</string> </key>
<value> <int>0</int> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
<value> <value>
<tuple> <tuple>
<string>form_id</string>
<string>kw</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>paysheet</string> <string>paysheet</string>
<string>paysheet_type</string> <string>paysheet_type</string>
<string>employer</string> <string>employer</string>
<string>employee</string> <string>employee</string>
<string>None</string> <string>N_</string>
<string>redirect</string>
<string>employer_obj</string> <string>employer_obj</string>
<string>employee_obj</string> <string>employee_obj</string>
<string>default_address</string>
</tuple> </tuple>
</value> </value>
</item> </item>
...@@ -190,7 +178,9 @@ return context.REQUEST.RESPONSE.redirect(context.absolute_url() + "/PaySheetTran ...@@ -190,7 +178,9 @@ return context.REQUEST.RESPONSE.redirect(context.absolute_url() + "/PaySheetTran
<item> <item>
<key> <string>func_defaults</string> </key> <key> <string>func_defaults</string> </key>
<value> <value>
<none/> <tuple>
<string>view</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
......
211 212
\ 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