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
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
Nikola Balog
erp5
Commits
17b1272d
Commit
17b1272d
authored
Apr 28, 2017
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bt5_config: Move all attributes to sub-objects and donot reindex them
parent
0cd284ed
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
6 deletions
+21
-6
product/ERP5/Document/BusinessManager.py
product/ERP5/Document/BusinessManager.py
+11
-3
product/ERP5/Tool/TemplateTool.py
product/ERP5/Tool/TemplateTool.py
+10
-3
No files found.
product/ERP5/Document/BusinessManager.py
View file @
17b1272d
...
...
@@ -278,7 +278,9 @@ class BusinessManager(Folder):
imported_manager
=
connection
.
importFile
(
file
)
self
.
title
=
imported_manager
.
title
for
obj
in
imported_manager
.
objectValues
():
delattr
(
obj
,
'__ac_local_roles__'
)
self
.
_setObject
(
obj
.
getId
(),
aq_base
(
obj
))
obj
.
isIndexable
=
ConstantGetter
(
'isIndexable'
,
value
=
False
)
self
.
setProperty
(
'template_path_list'
,
imported_manager
.
getProperty
(
'template_path_list'
))
def
__add__
(
self
,
other
):
...
...
@@ -674,7 +676,8 @@ class BusinessItem(XMLObject):
# XXX: '_recursiveRemoveUid' is not working as expected
_recursiveRemoveUid
(
obj
)
obj
=
aq_base
(
obj
)
self
.
_setObject
(
obj
.
getId
(),
obj
)
obj
.
isIndexable
=
ConstantGetter
(
'isIndexable'
,
value
=
False
)
self
.
_setObject
(
obj
.
getId
(),
obj
,
suppress_events
=
True
)
except
AttributeError
:
# In case the object doesn't exist, just pass without raising error
pass
...
...
@@ -783,13 +786,18 @@ class BusinessItem(XMLObject):
# install object
obj
=
self
.
objectValues
()[
0
]
obj
=
obj
.
_getCopy
(
container
)
container
.
_setObject
(
object_id
,
obj
)
obj
=
container
.
_getOb
(
object_id
)
# Before making `obj` a sub-object of `container`, we should the acquired
# roles on obj
obj
.
isIndexable
=
ConstantGetter
(
'isIndexable'
,
value
=
False
)
delattr
(
obj
,
'__ac_local_roles__'
)
container
.
_setObject
(
object_id
,
obj
,
suppress_events
=
True
)
obj
=
container
.
_getOb
(
object_id
)
"""
aq_base(obj).uid = portal.portal_catalog.newUid()
del obj.isIndexable
if getattr(aq_base(obj), 'reindexObject', None) is not None:
obj.reindexObject()
"""
def
unrestrictedResolveValue
(
self
,
context
=
None
,
path
=
''
,
default
=
_MARKER
,
restricted
=
0
):
...
...
product/ERP5/Tool/TemplateTool.py
View file @
17b1272d
...
...
@@ -46,6 +46,7 @@ from Products.ERP5Type.Tool.BaseTool import BaseTool
from
Products.ERP5Type.Cache
import
transactional_cached
from
Products.ERP5Type
import
Permissions
from
Products.ERP5.Document.BusinessTemplate
import
BusinessTemplateMissingDependency
from
Products.ERP5Type.Accessor.Constant
import
PropertyGetter
as
ConstantGetter
from
Products.ERP5.genbt5list
import
generateInformation
from
Acquisition
import
aq_base
from
tempfile
import
mkstemp
,
mkdtemp
...
...
@@ -1700,7 +1701,9 @@ class TemplateTool (BaseTool):
title
=
'Old Installation State'
,
)
for
item
in
combined_installed_path_item
:
old_installation_state
.
_setObject
(
item
.
getId
(),
aq_base
(
item
))
item
.
isIndexable
=
ConstantGetter
(
'isIndexable'
,
value
=
False
)
old_installation_state
.
_setObject
(
item
.
getId
(),
aq_base
(
item
),
suppress_events
=
True
)
forbidden_bm_title_list
=
[
'Old Installation State'
,]
for
bm
in
bm_list
:
...
...
@@ -1722,7 +1725,9 @@ class TemplateTool (BaseTool):
)
for
item
in
combined_new_path_item
:
new_installation_state
.
_setObject
(
item
.
getId
(),
aq_base
(
item
))
item
.
isIndexable
=
ConstantGetter
(
'isIndexable'
,
value
=
False
)
new_installation_state
.
_setObject
(
item
.
getId
(),
aq_base
(
item
),
suppress_events
=
True
)
# Create installation process, which have the changes to be made in the
# OFS during installation. Importantly, it should also be a Business Manager
...
...
@@ -1772,7 +1777,9 @@ class TemplateTool (BaseTool):
to_install_path_item_list
.
append
(
item
)
for
item
in
to_install_path_item_list
:
installation_process
.
_setObject
(
item
.
getId
(),
aq_base
(
item
))
item
.
isIndexable
=
ConstantGetter
(
'isIndexable'
,
value
=
False
)
installation_process
.
_setObject
(
item
.
getId
(),
aq_base
(
item
),
suppress_events
=
True
)
error_list
=
self
.
compareOldStateToOFS
(
installation_process
,
old_installation_state
)
...
...
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