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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
erp5
Commits
eb571356
Commit
eb571356
authored
Aug 17, 2017
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web: allow to use web_view action if object has no data
parent
36353614
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
2 deletions
+35
-2
bt5/erp5_web/ActionTemplateItem/portal_types/File/web_view.xml
...rp5_web/ActionTemplateItem/portal_types/File/web_view.xml
+1
-1
bt5/erp5_web/ActionTemplateItem/portal_types/Image/web_view.xml
...p5_web/ActionTemplateItem/portal_types/Image/web_view.xml
+1
-1
product/ERP5/tests/testERP5WebWithDms.py
product/ERP5/tests/testERP5WebWithDms.py
+33
-0
No files found.
bt5/erp5_web/ActionTemplateItem/portal_types/File/web_view.xml
View file @
eb571356
...
...
@@ -88,7 +88,7 @@
<dictionary>
<item>
<key>
<string>
text
</string>
</key>
<value>
<string>
python:object is not None and object.isWebMode() and
object.hasData() and
not object.isEditableMode()
</string>
</value>
<value>
<string>
python:object is not None and object.isWebMode() and not object.isEditableMode()
</string>
</value>
</item>
</dictionary>
</pickle>
...
...
bt5/erp5_web/ActionTemplateItem/portal_types/Image/web_view.xml
View file @
eb571356
...
...
@@ -88,7 +88,7 @@
<dictionary>
<item>
<key>
<string>
text
</string>
</key>
<value>
<string>
python:object is not None and object.isWebMode() and
object.hasData() and
not object.isEditableMode()
</string>
</value>
<value>
<string>
python:object is not None and object.isWebMode() and not object.isEditableMode()
</string>
</value>
</item>
</dictionary>
</pickle>
...
...
product/ERP5/tests/testERP5WebWithDms.py
View file @
eb571356
...
...
@@ -1648,6 +1648,39 @@ return True
sorted
([
i
.
getUid
()
for
i
in
img_list
]),
)
def
test_checkWebSiteFileViewConsistency
(
self
):
"""
Checks that the default view action of a File, viewing from a web site,
is File_viewAsWeb.
(i.e .../document_module/1/ == .../document_module/1/File_viewAsWeb)
"""
web_site
=
self
.
setupWebSite
()
# check when the file is empty
file_object
=
self
.
portal
.
document_module
.
newContent
(
portal_type
=
"File"
)
file_object
.
publish
()
self
.
tic
()
path
=
'%s/document_module/%s/'
%
(
web_site
.
absolute_url_path
(),
file_object
.
getId
())
response_a
=
self
.
publish
(
path
)
response_b
=
self
.
publish
(
path
+
"File_viewAsWeb"
)
self
.
assertEqual
(
response_a
.
getBody
(),
response_b
.
getBody
())
def
test_checkWebSiteImageViewConsistency
(
self
):
"""
Checks that the default view action of a Image, viewing from a web site,
is Image_viewAsWeb.
(i.e .../image_module/1/ == .../image_module/1/Image_viewAsWeb)
"""
web_site
=
self
.
setupWebSite
()
image_object
=
self
.
portal
.
image_module
.
newContent
(
portal_type
=
"Image"
)
image_object
.
publish
()
self
.
tic
()
path
=
'%s/image_module/%s/'
%
(
web_site
.
absolute_url_path
(),
image_object
.
getId
())
response_a
=
self
.
publish
(
path
)
response_b
=
self
.
publish
(
path
+
"Image_viewAsWeb"
)
self
.
assertEqual
(
response_a
.
getBody
(),
response_b
.
getBody
())
def
test_suite
():
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
unittest
.
makeSuite
(
TestERP5WebWithDms
))
...
...
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