Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ayush Tiwari
erp5
Commits
e4855960
Commit
e4855960
authored
Apr 28, 2017
by
Ayush Tiwari
Committed by
Ayush Tiwari
Nov 09, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bt5_config: Move all attributes to sub-objects and donot reindex them
parent
407122cf
Changes
2
Show 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 @
e4855960
...
@@ -278,7 +278,9 @@ class BusinessManager(Folder):
...
@@ -278,7 +278,9 @@ class BusinessManager(Folder):
imported_manager
=
connection
.
importFile
(
file
)
imported_manager
=
connection
.
importFile
(
file
)
self
.
title
=
imported_manager
.
title
self
.
title
=
imported_manager
.
title
for
obj
in
imported_manager
.
objectValues
():
for
obj
in
imported_manager
.
objectValues
():
delattr
(
obj
,
'__ac_local_roles__'
)
self
.
_setObject
(
obj
.
getId
(),
aq_base
(
obj
))
self
.
_setObject
(
obj
.
getId
(),
aq_base
(
obj
))
obj
.
isIndexable
=
ConstantGetter
(
'isIndexable'
,
value
=
False
)
self
.
setProperty
(
'template_path_list'
,
imported_manager
.
getProperty
(
'template_path_list'
))
self
.
setProperty
(
'template_path_list'
,
imported_manager
.
getProperty
(
'template_path_list'
))
def
__add__
(
self
,
other
):
def
__add__
(
self
,
other
):
...
@@ -674,7 +676,8 @@ class BusinessItem(XMLObject):
...
@@ -674,7 +676,8 @@ class BusinessItem(XMLObject):
# XXX: '_recursiveRemoveUid' is not working as expected
# XXX: '_recursiveRemoveUid' is not working as expected
_recursiveRemoveUid
(
obj
)
_recursiveRemoveUid
(
obj
)
obj
=
aq_base
(
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
:
except
AttributeError
:
# In case the object doesn't exist, just pass without raising error
# In case the object doesn't exist, just pass without raising error
pass
pass
...
@@ -783,13 +786,18 @@ class BusinessItem(XMLObject):
...
@@ -783,13 +786,18 @@ class BusinessItem(XMLObject):
# install object
# install object
obj
=
self
.
objectValues
()[
0
]
obj
=
self
.
objectValues
()[
0
]
obj
=
obj
.
_getCopy
(
container
)
obj
=
obj
.
_getCopy
(
container
)
container
.
_setObject
(
object_id
,
obj
)
# Before making `obj` a sub-object of `container`, we should the acquired
obj
=
container
.
_getOb
(
object_id
)
# roles on obj
obj
.
isIndexable
=
ConstantGetter
(
'isIndexable'
,
value
=
False
)
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()
aq_base(obj).uid = portal.portal_catalog.newUid()
del obj.isIndexable
del obj.isIndexable
if getattr(aq_base(obj), 'reindexObject', None) is not None:
if getattr(aq_base(obj), 'reindexObject', None) is not None:
obj.reindexObject()
obj.reindexObject()
"""
def
unrestrictedResolveValue
(
self
,
context
=
None
,
path
=
''
,
default
=
_MARKER
,
def
unrestrictedResolveValue
(
self
,
context
=
None
,
path
=
''
,
default
=
_MARKER
,
restricted
=
0
):
restricted
=
0
):
...
...
product/ERP5/Tool/TemplateTool.py
View file @
e4855960
...
@@ -46,6 +46,7 @@ from Products.ERP5Type.Tool.BaseTool import BaseTool
...
@@ -46,6 +46,7 @@ from Products.ERP5Type.Tool.BaseTool import BaseTool
from
Products.ERP5Type.Cache
import
transactional_cached
from
Products.ERP5Type.Cache
import
transactional_cached
from
Products.ERP5Type
import
Permissions
from
Products.ERP5Type
import
Permissions
from
Products.ERP5.Document.BusinessTemplate
import
BusinessTemplateMissingDependency
from
Products.ERP5.Document.BusinessTemplate
import
BusinessTemplateMissingDependency
from
Products.ERP5Type.Accessor.Constant
import
PropertyGetter
as
ConstantGetter
from
Products.ERP5.genbt5list
import
generateInformation
from
Products.ERP5.genbt5list
import
generateInformation
from
Acquisition
import
aq_base
from
Acquisition
import
aq_base
from
tempfile
import
mkstemp
,
mkdtemp
from
tempfile
import
mkstemp
,
mkdtemp
...
@@ -1703,7 +1704,9 @@ class TemplateTool (BaseTool):
...
@@ -1703,7 +1704,9 @@ class TemplateTool (BaseTool):
title
=
'Old Installation State'
,
title
=
'Old Installation State'
,
)
)
for
item
in
combined_installed_path_item
:
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'
,]
forbidden_bm_title_list
=
[
'Old Installation State'
,]
for
bm
in
bm_list
:
for
bm
in
bm_list
:
...
@@ -1725,7 +1728,9 @@ class TemplateTool (BaseTool):
...
@@ -1725,7 +1728,9 @@ class TemplateTool (BaseTool):
)
)
for
item
in
combined_new_path_item
:
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
# Create installation process, which have the changes to be made in the
# OFS during installation. Importantly, it should also be a Business Manager
# OFS during installation. Importantly, it should also be a Business Manager
...
@@ -1775,7 +1780,9 @@ class TemplateTool (BaseTool):
...
@@ -1775,7 +1780,9 @@ class TemplateTool (BaseTool):
to_install_path_item_list
.
append
(
item
)
to_install_path_item_list
.
append
(
item
)
for
item
in
to_install_path_item_list
:
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
)
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