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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Vincent Bechu
erp5
Commits
646b1f94
Commit
646b1f94
authored
Nov 14, 2018
by
Aurel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prevent multiple conversions of report when storing as document
parent
5b6f364a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
7 deletions
+12
-7
bt5/erp5_deferred_style/SkinTemplateItem/portal_skins/erp5_deferred_style_core/Base_report.py
...Item/portal_skins/erp5_deferred_style_core/Base_report.py
+7
-3
bt5/erp5_deferred_style/SkinTemplateItem/portal_skins/erp5_deferred_style_core/ERP5Site_notifyReportComplete.py
...erp5_deferred_style_core/ERP5Site_notifyReportComplete.py
+4
-3
bt5/erp5_deferred_style/SkinTemplateItem/portal_skins/erp5_deferred_style_core/ERP5Site_notifyReportComplete.xml
...rp5_deferred_style_core/ERP5Site_notifyReportComplete.xml
+1
-1
No files found.
bt5/erp5_deferred_style/SkinTemplateItem/portal_skins/erp5_deferred_style_core/Base_report.py
View file @
646b1f94
...
@@ -23,9 +23,12 @@ with portal.Localizer.translationContext(localizer_language):
...
@@ -23,9 +23,12 @@ with portal.Localizer.translationContext(localizer_language):
return
data
.
decode
(
'bz2'
)
return
data
.
decode
(
'bz2'
)
except
IOError
:
except
IOError
:
return
data
.
decode
(
'zlib'
)
return
data
.
decode
(
'zlib'
)
if
portal
.
portal_preferences
.
getPreferredDeferredReportStoredAsDocument
():
pt_render_format
=
None
else
:
pt_render_format
=
format
report_data
=
context
.
restrictedTraverse
(
form_path
).
report_view
.
pt_render
(
report_data
=
context
.
restrictedTraverse
(
form_path
).
report_view
.
pt_render
(
extra_context
=
dict
(
options
=
{
'format'
:
format
},
extra_context
=
dict
(
options
=
{
'format'
:
pt_render_
format
},
rendered_report_item_list
=
(
decodeReportSection
(
r
[
1
])
for
r
in
report_section_list
),
rendered_report_item_list
=
(
decodeReportSection
(
r
[
1
])
for
r
in
report_section_list
),
report_method
=
dummyReportMethod
,
report_method
=
dummyReportMethod
,
form
=
portal
.
restrictedTraverse
(
form_path
)))
form
=
portal
.
restrictedTraverse
(
form_path
)))
...
@@ -52,4 +55,5 @@ portal.ERP5Site_notifyReportComplete(
...
@@ -52,4 +55,5 @@ portal.ERP5Site_notifyReportComplete(
user_name
=
user_name
,
user_name
=
user_name
,
subject
=
title
,
subject
=
title
,
message
=
''
,
message
=
''
,
attachment_list
=
attachment_list
)
attachment_list
=
attachment_list
,
format
=
format
)
bt5/erp5_deferred_style/SkinTemplateItem/portal_skins/erp5_deferred_style_core/ERP5Site_notifyReportComplete.py
View file @
646b1f94
...
@@ -11,15 +11,16 @@ if prefs.getPreferredDeferredReportStoredAsDocument():
...
@@ -11,15 +11,16 @@ if prefs.getPreferredDeferredReportStoredAsDocument():
publication_section
=
prefs
.
getPreferredDeferredReportPublicationSection
(),
publication_section
=
prefs
.
getPreferredDeferredReportPublicationSection
(),
classification
=
prefs
.
getPreferredDeferredReportClassification
(),
classification
=
prefs
.
getPreferredDeferredReportClassification
(),
filename
=
attachment
[
'name'
],
filename
=
attachment
[
'name'
],
title
=
attachment
[
'name'
],)
#title=attachment['name'],
)
document
.
share
()
document
.
share
()
report_item_list
.
append
(
report_item_list
.
append
(
(
attachment
.
get
(
'title'
,
attachment
[
'name'
]),
(
attachment
.
get
(
'title'
,
document
.
getStandardFilename
(
format
=
format
)),
#
attachment['name']),
document
.
getRelativeUrl
()))
document
.
getRelativeUrl
()))
url_base
=
portal
.
ERP5Site_getAbsoluteUrl
()
url_base
=
portal
.
ERP5Site_getAbsoluteUrl
()
report_url_text
=
'<br/>'
.
join
([
report_url_text
=
'<br/>'
.
join
([
'''<a href="%s/%s
">%s</a>'''
%
(
url_base
,
report_url
,
report_name
)
for
(
report_name
,
report_url
)
in
report_item_list
])
'''<a href="%s/%s
?format=%s">%s</a>'''
%
(
url_base
,
report_url
,
format
,
report_name
)
for
(
report_name
,
report_url
)
in
report_item_list
])
message
=
'%s<br/>%s'
%
(
newline_to_br
(
html_quote
(
message
)),
report_url_text
)
message
=
'%s<br/>%s'
%
(
newline_to_br
(
html_quote
(
message
)),
report_url_text
)
message_text_format
=
"text/html"
message_text_format
=
"text/html"
attachment_list
=
[]
attachment_list
=
[]
...
...
bt5/erp5_deferred_style/SkinTemplateItem/portal_skins/erp5_deferred_style_core/ERP5Site_notifyReportComplete.xml
View file @
646b1f94
...
@@ -50,7 +50,7 @@
...
@@ -50,7 +50,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
_params
</string>
</key>
<key>
<string>
_params
</string>
</key>
<value>
<string>
user_name, subject, message, attachment_list
</string>
</value>
<value>
<string>
user_name, subject, message, attachment_list
, format=None
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
_proxy_roles
</string>
</key>
<key>
<string>
_proxy_roles
</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