Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
e8fbe698
Commit
e8fbe698
authored
Feb 28, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
payroll_l10n_fr: use Base_redirect to redirect in Make DSN Report script
parent
09aa15b7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
bt5/erp5_payroll_l10n_fr/SkinTemplateItem/portal_skins/erp5_payroll_l10n_fr/DSNMonthlyReport_makeReport.py
...skins/erp5_payroll_l10n_fr/DSNMonthlyReport_makeReport.py
+10
-3
bt5/erp5_payroll_l10n_fr/SkinTemplateItem/portal_skins/erp5_payroll_l10n_fr/DSNMonthlyReport_makeReport.xml
...kins/erp5_payroll_l10n_fr/DSNMonthlyReport_makeReport.xml
+1
-1
No files found.
bt5/erp5_payroll_l10n_fr/SkinTemplateItem/portal_skins/erp5_payroll_l10n_fr/DSNMonthlyReport_makeReport.py
View file @
e8fbe698
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 com
p
any
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
bt5/erp5_payroll_l10n_fr/SkinTemplateItem/portal_skins/erp5_payroll_l10n_fr/DSNMonthlyReport_makeReport.xml
View file @
e8fbe698
...
...
@@ -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>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment