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
0
Merge Requests
0
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
Tomáš Peterka
erp5
Commits
93b91fef
Commit
93b91fef
authored
Feb 10, 2016
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ods_style: make `sheet_per_report_section` compatible with deferred style
parent
cd3b6608
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
4 deletions
+48
-4
bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/report_view.xml
...nTemplateItem/portal_skins/erp5_ods_style/report_view.xml
+16
-4
product/ERP5OOo/tests/testDeferredStyle.py
product/ERP5OOo/tests/testDeferredStyle.py
+32
-0
No files found.
bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/report_view.xml
View file @
93b91fef
...
...
@@ -136,14 +136,26 @@
</table:table>
\n
</tal:block>
\n
<tal:block
tal:condition=
"sheet_per_report_section"
>
\n
<tal:block
tal:repeat=
"report_item python: report_item_list"
>
\n
<tal:block
tal:condition=
"python: report_item.getFormId()"
>
\n
<table:table
tal:attributes=
"table:name python: unicode(report_item.getTitle() or \'Sheet%s\' % repeat[\'report_item\'].index, \'utf-8\')"
>
\n
<tal:block
tal:condition=
"rendered_report_item_list"
>
\n
<tal:block
tal:repeat=
"report_item report_item_list"
>
\n
<!-- FIXME: in deferred mode + sheet_per_report_section we do not have title -->
\n
<table:table
tal:attributes=
"table:name python: unicode(\'Sheet%s\' % repeat[\'report_item\'].index, \'utf-8\')"
>
\n
<table:table-column
table:style-name=
"co4"
table:default-cell-style-name=
"text"
/>
\n
<tal:block
metal:use-macro=
"here/report_view/macros/make_report_item_table
"
/>
\n
<tal:block
tal:replace=
"structure report_item
"
/>
\n
</table:table>
\n
</tal:block>
\n
</tal:block>
\n
\n
<tal:block
tal:condition=
"not: rendered_report_item_list"
>
\n
<tal:block
tal:repeat=
"report_item python: report_item_list"
>
\n
<tal:block
tal:condition=
"python: report_item.getFormId()"
>
\n
<table:table
tal:attributes=
"table:name python: unicode(report_item.getTitle() or \'Sheet%s\' % repeat[\'report_item\'].index, \'utf-8\')"
>
\n
<table:table-column
table:style-name=
"co4"
table:default-cell-style-name=
"text"
/>
\n
<tal:block
metal:use-macro=
"here/report_view/macros/make_report_item_table"
/>
\n
</table:table>
\n
</tal:block>
\n
</tal:block>
\n
</tal:block>
\n
\n
<!-- include the report header as last page -->
\n
<table:table
tal:attributes=
"table:name python:unicode(form.getProperty(\'title\'), \'utf8\')"
i18n:attributes=
"table:name"
>
\n
...
...
product/ERP5OOo/tests/testDeferredStyle.py
View file @
93b91fef
...
...
@@ -149,6 +149,38 @@ class TestODSDeferredStyle(TestDeferredStyle):
content_type
=
'application/vnd.oasis.opendocument.spreadsheet'
attachment_file_extension
=
'.ods'
def
test_report_view_sheet_per_report_section
(
self
):
"""Test the sheet_per_report_section feature of erp5_ods_style.
"""
self
.
loginAsUser
(
'bob'
)
self
.
portal
.
changeSkin
(
'Deferred'
)
response
=
self
.
publish
(
'/%s/person_module/pers/Base_viewHistory?deferred_portal_skin=%s&sheet_per_report_section:int=1'
%
(
self
.
portal
.
getId
(),
self
.
skin
),
'%s:%s'
%
(
self
.
username
,
self
.
password
))
self
.
tic
()
last_message
=
self
.
portal
.
MailHost
.
_last_message
self
.
assertNotEquals
((),
last_message
)
mfrom
,
mto
,
message_text
=
last_message
self
.
assertEqual
(
'"%s" <%s>'
%
(
self
.
first_name
,
self
.
recipient_email_address
),
mto
[
0
])
mail_message
=
email
.
message_from_string
(
message_text
)
for
part
in
mail_message
.
walk
():
content_type
=
part
.
get_content_type
()
file_name
=
part
.
get_filename
()
if
content_type
==
self
.
content_type
:
# "History" is the title of Base_viewHistory form
file_name
=
part
.
get_filename
()
expected_file_name
=
'History%s'
%
self
.
attachment_file_extension
self
.
assertEqual
(
expected_file_name
,
file_name
)
self
.
assertEqual
(
'attachment; filename="%s"'
%
expected_file_name
,
part
.
get
(
'Content-Disposition'
))
data
=
part
.
get_payload
(
decode
=
True
)
error_list
=
Validator
().
validate
(
data
)
if
error_list
:
self
.
fail
(
''
.
join
(
error_list
))
break
else
:
self
.
fail
(
'Attachment not found in email
\
n
%s'
%
message_text
)
class
TestODTDeferredStyle
(
TestDeferredStyle
):
skin
=
'ODT'
...
...
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