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

payroll_l10n_fr: use Base_redirect to redirect in Make DSN Report script

parent 09aa15b7
from Products.ERP5Type.Message import translateString
from erp5.component.module.DateUtils import addToDate, getNumberOfDayInMonth
if context.getSourceAdministration() is None \
or context.getEffectiveDate() is None \
or context.getQuantity() is None:
return context.REQUEST.response.redirect("%s?portal_status_message=%s" % (context.absolute_url(), "DSN can't be built if some fields are empty"))
return context.Base_redirect(form_id, keep_items={
'portal_status_message': translateString("DSN can't be built if some fields are empty"),
'portal_status_level': 'error',
})
portal = context.getPortalObject()
accounting_module = portal.getDefaultModuleValue("Pay Sheet Transaction")
......@@ -39,7 +43,7 @@ else:
establishment = context.getSourceTradeValue()
establishment_registration_code = ''.join(establishment.getCorporateRegistrationCode().split(' '))
# Finds the head office of the comany
# Finds the head office of the company
if len(payment_transaction_list):
organisation = payment_transaction_list[0].getSourceSectionValue()
elif len(paysheet_list):
......@@ -438,4 +442,7 @@ if batch_mode:
context.REQUEST.response.setHeader("Content-Type", "text/plain; charset=iso-8859-1")
return
context.REQUEST.response.redirect("%s?portal_status_message=%s" % (context.absolute_url(), "Monthly DSN Record Created."))
return context.Base_redirect(form_id, keep_items={
'portal_status_message': translateString("Monthly DSN Record Created."),
'portal_status_level': 'success',
})
\ No newline at end of file
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>batch_mode=False</string> </value>
<value> <string>form_id=\'\', batch_mode=False</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
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