Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5-Boxiang
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
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
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hamza
erp5-Boxiang
Commits
eaf027b2
Commit
eaf027b2
authored
Jun 06, 2016
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BT: remove _EtagSupport__etag/size properties when exporting Files/Images
parent
d7acbf30
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
product/ERP5/Document/BusinessTemplate.py
product/ERP5/Document/BusinessTemplate.py
+6
-0
product/ERP5/tests/testTemplateTool.py
product/ERP5/tests/testTemplateTool.py
+3
-2
No files found.
product/ERP5/Document/BusinessTemplate.py
View file @
eaf027b2
...
...
@@ -66,6 +66,7 @@ from Products.ERP5Type.dynamic.lazy_class import ERP5BaseBroken
from
Products.ERP5Type.dynamic.portal_type_class
import
synchronizeDynamicModules
from
Products.ERP5Type.Core.PropertySheet
import
PropertySheet
as
PropertySheetDocument
from
Products.ERP5Type.TransactionalVariable
import
getTransactionalVariable
from
Products.ERP5.Document.File
import
File
from
OFS.Traversable
import
NotFound
from
OFS
import
SimpleItem
,
XMLExportImport
from
OFS.Image
import
Pdata
...
...
@@ -617,6 +618,8 @@ class BaseTemplateItem(Implicit, Persistent):
for
attr
in
'errors'
,
'warnings'
,
'_proxy_roles'
:
if
not
obj
.
__dict__
.
get
(
attr
,
1
):
delattr
(
obj
,
attr
)
elif
classname
in
(
'File'
,
'Image'
):
attr_set
.
update
((
'_EtagSupport__etag'
,
'size'
))
elif
classname
==
'SQL'
and
klass
.
__module__
==
'Products.ZSQLMethods.SQL'
:
attr_set
.
update
((
'_arg'
,
'template'
))
elif
interfaces
.
IIdGenerator
.
providedBy
(
obj
):
...
...
@@ -1462,6 +1465,9 @@ class ObjectTemplateItem(BaseTemplateItem):
assert
container
.
meta_type
in
(
'ERP5 Cache Factory'
,
'ERP5 Cache Bag'
)
container
.
getParentValue
().
updateCache
()
elif
obj
.
__class__
.
__name__
in
(
'File'
,
'Image'
):
if
"data"
in
obj
.
__dict__
:
File
.
_setData
.
__func__
(
obj
,
obj
.
data
)
elif
(
container
.
meta_type
==
'CMF Skins Tool'
)
and
\
(
old_obj
is
not
None
):
# Keep compatibility with previous export format of
...
...
product/ERP5/tests/testTemplateTool.py
View file @
eaf027b2
...
...
@@ -363,6 +363,7 @@ class TestTemplateTool(ERP5TypeTestCase):
# We don't export revision anymore.
self
.
assertFalse
(
os
.
path
.
exists
(
os
.
path
.
join
(
root
,
'bt'
,
'revision'
)))
# Computed at download ...
revision
=
'+Kds1k1J41hzO4yIO+GcKQukNps='
self
.
assertEqual
(
revision
,
template_tool
.
download
(
root
).
getRevision
())
finally
:
shutil
.
rmtree
(
root
)
...
...
@@ -370,14 +371,14 @@ class TestTemplateTool(ERP5TypeTestCase):
# ... at building by default ...
bt
.
build
()
revision
=
bt
.
getRevision
()
self
.
assertEqual
(
'
9rVhiz7Agr5G7L1jegm9yLuUD9U
='
,
revision
)
self
.
assertEqual
(
'
xR/n0PtLoc+1CR0AyJ+xGjbxsjE
='
,
revision
)
self
.
portal
.
portal_skins
.
erp5_test
.
manage_renameObject
(
'test_file'
,
'test_file2'
)
bt
.
build
(
update_revision
=
False
)
self
.
assertEqual
(
revision
,
bt
.
getRevision
())
# ... and at export.
bt
.
export
(
str
(
random
.
random
()))
self
.
assertEqual
(
'
dhgvzCfmibJEiy5M+5axf9ZM3gA
='
,
bt
.
getRevision
())
self
.
assertEqual
(
'
fnLZVdsjkNDoC0JWstMY2XL1x+s
='
,
bt
.
getRevision
())
self
.
abort
()
def
test_getInstalledBusinessTemplateList
(
self
):
...
...
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