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
iv
erp5
Commits
e7a50455
Commit
e7a50455
authored
Nov 16, 2016
by
iv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Workflow: fix installation of bt when objects to install are Persistent Mapping Folders
parent
6bef463e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
9 deletions
+17
-9
product/ERP5/Document/BusinessTemplate.py
product/ERP5/Document/BusinessTemplate.py
+17
-9
No files found.
product/ERP5/Document/BusinessTemplate.py
View file @
e7a50455
...
...
@@ -94,6 +94,8 @@ from ZODB.broken import Broken, BrokenModified
from
Products.ERP5.genbt5list
import
BusinessTemplateRevision
,
\
item_name_list
,
item_set
from
Products.ERP5Type.Core.Folder
import
PERSISTENT_MAPPING_HANDLER
CACHE_DATABASE_PATH
=
None
try
:
if
int
(
os
.
getenv
(
'ERP5_BT5_CACHE'
,
0
)):
...
...
@@ -1368,15 +1370,21 @@ class ObjectTemplateItem(BaseTemplateItem):
# because they change when we add subobjects
groups
[
path
]
=
deepcopy
(
obj
.
groups
)
# copy the object
if
(
getattr
(
aq_base
(
obj
),
'_mt_index'
,
None
)
is
not
None
and
obj
.
_count
()
==
0
):
# some btrees were exported in a corrupted state. They're empty but
# their metadata-index (._mt_index) contains entries which in
# Zope 2.12 are used for .objectIds(), .objectValues() and
# .objectItems(). In these cases, force the
LOG
(
'Products.ERP5.Document.BusinessTemplate'
,
WARNING
,
'Cleaning corrupted BTreeFolder2 object at %r.'
%
(
path
,))
obj
.
_initBTrees
()
if
getattr
(
obj
,
'_folder_handler'
,
None
)
==
PERSISTENT_MAPPING_HANDLER
:
# XXX(WORKFLOW): if obj._count(), then, we should export the content
# of the btree folder to the persistent mapping one
obj
.
_cleanup
()
obj
.
__init__
(
obj
.
id
)
else
:
if
(
getattr
(
aq_base
(
obj
),
'_mt_index'
,
None
)
is
not
None
and
obj
.
_count
()
==
0
):
# some btrees were exported in a corrupted state. They're empty but
# their metadata-index (._mt_index) contains entries which in
# Zope 2.12 are used for .objectIds(), .objectValues() and
# .objectItems(). In these cases, force the
LOG
(
'Products.ERP5.Document.BusinessTemplate'
,
WARNING
,
'Cleaning corrupted BTreeFolder2 object at %r.'
%
(
path
,))
obj
.
_initBTrees
()
obj
=
obj
.
_getCopy
(
container
)
self
.
removeProperties
(
obj
,
0
)
__traceback_info__
=
(
container
,
object_id
,
obj
)
...
...
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