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
147
Merge Requests
147
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
7784f78c
Commit
7784f78c
authored
Oct 07, 2019
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BusinessTemplate: File is imported as PData
parent
7047b7d8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
0 deletions
+7
-0
product/ERP5/Document/BusinessTemplate.py
product/ERP5/Document/BusinessTemplate.py
+3
-0
product/ERP5/tests/testBusinessTemplate.py
product/ERP5/tests/testBusinessTemplate.py
+4
-0
No files found.
product/ERP5/Document/BusinessTemplate.py
View file @
7784f78c
...
...
@@ -94,6 +94,7 @@ import threading
from
ZODB.broken
import
Broken
,
BrokenModified
from
Products.ERP5.genbt5list
import
BusinessTemplateRevision
,
\
item_name_list
,
item_set
from
OFS.Image
import
File
as
OFSFile
CACHE_DATABASE_PATH
=
None
try
:
...
...
@@ -895,6 +896,8 @@ class ObjectTemplateItem(BaseTemplateItem):
obj
.
__class__
.
__name__
][
1
:]
if
unicode_data
:
data
=
data
.
decode
(
obj
.
output_encoding
)
if
isinstance
(
obj
,
OFSFile
):
data
=
obj
.
_read_data
(
data
)[
0
]
try
:
setattr
(
obj
,
property_name
,
data
)
except
BrokenModified
:
...
...
product/ERP5/tests/testBusinessTemplate.py
View file @
7784f78c
...
...
@@ -50,6 +50,7 @@ import string
import
tempfile
import
glob
import
sys
from
OFS.Image
import
Pdata
WORKFLOW_TYPE
=
'erp5_workflow'
...
...
@@ -3401,6 +3402,9 @@ class TestBusinessTemplate(BusinessTemplateMixin):
"""Tests the Title of the Template Tool."""
self
.
assertEqual
(
'Template Tool'
,
self
.
getTemplateTool
().
Title
())
def
test_00_checkFileisPDataInstance
(
self
):
self
.
assertIsInstance
(
self
.
portal
.
portal_skins
.
erp5_ckeditor
.
ckeditor
[
'LICENSE.md'
].
data
,
Pdata
)
def
test_01_checkNewSite
(
self
):
"""Test Check New Site"""
sequence_list
=
SequenceList
()
...
...
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