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
Joshua
erp5
Commits
b999ac04
Commit
b999ac04
authored
Apr 14, 2017
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bt5_config: _path_item_list should be PersistentList
parent
bfcbe492
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
10 deletions
+11
-10
product/ERP5/Document/BusinessManager.py
product/ERP5/Document/BusinessManager.py
+11
-10
No files found.
product/ERP5/Document/BusinessManager.py
View file @
b999ac04
...
@@ -39,6 +39,7 @@ import fnmatch
...
@@ -39,6 +39,7 @@ import fnmatch
import
re
import
re
import
threading
import
threading
import
pprint
import
pprint
from
copy
import
deepcopy
from
copy
import
deepcopy
from
collections
import
defaultdict
from
collections
import
defaultdict
from
cStringIO
import
StringIO
from
cStringIO
import
StringIO
...
@@ -49,19 +50,22 @@ from OFS import SimpleItem, XMLExportImport
...
@@ -49,19 +50,22 @@ from OFS import SimpleItem, XMLExportImport
from
datetime
import
datetime
from
datetime
import
datetime
from
itertools
import
chain
from
itertools
import
chain
from
operator
import
attrgetter
from
operator
import
attrgetter
from
persistent.list
import
PersistentList
from
AccessControl
import
ClassSecurityInfo
,
Unauthorized
,
getSecurityManager
from
Acquisition
import
Implicit
,
aq_base
,
aq_inner
,
aq_parent
from
zLOG
import
LOG
,
INFO
,
WARNING
from
Products.ERP5Type.XMLObject
import
XMLObject
from
Products.ERP5Type.XMLObject
import
XMLObject
from
Products.CMFCore.utils
import
getToolByName
from
Products.CMFCore.utils
import
getToolByName
from
Products.PythonScripts.PythonScript
import
PythonScript
from
Products.PythonScripts.PythonScript
import
PythonScript
from
Products.ERP5Type.dynamic.lazy_class
import
ERP5BaseBroken
from
Products.ERP5Type.dynamic.lazy_class
import
ERP5BaseBroken
from
Products.ERP5Type.Globals
import
Persistent
,
PersistentMapping
from
Products.ERP5Type.Globals
import
Persistent
,
PersistentMapping
from
Products.ERP5Type
import
Permissions
,
PropertySheet
,
interfaces
from
Products.ERP5Type
import
Permissions
,
PropertySheet
,
interfaces
from
AccessControl
import
ClassSecurityInfo
,
Unauthorized
,
getSecurityManager
from
Acquisition
import
Implicit
,
aq_base
,
aq_inner
,
aq_parent
from
Products.ERP5Type.Globals
import
InitializeClass
from
Products.ERP5Type.Globals
import
InitializeClass
from
Products.ERP5Type.TransactionalVariable
import
getTransactionalVariable
from
Products.ERP5Type.TransactionalVariable
import
getTransactionalVariable
from
zLOG
import
LOG
,
INFO
,
WARNING
from
Products.ERP5Type.patches.ppml
import
importXML
from
Products.ERP5Type.patches.ppml
import
importXML
from
Products.ERP5Type.Accessor.Constant
import
PropertyGetter
as
ConstantGetter
from
Products.ERP5Type.Accessor.Constant
import
PropertyGetter
as
ConstantGetter
customImporters
=
{
customImporters
=
{
XMLExportImport
.
magic
:
importXML
,
XMLExportImport
.
magic
:
importXML
,
}
}
...
@@ -236,17 +240,14 @@ class BusinessManager(XMLObject):
...
@@ -236,17 +240,14 @@ class BusinessManager(XMLObject):
final_prop_map
=
prop_map
+
self
.
_properties
final_prop_map
=
prop_map
+
self
.
_properties
return
final_prop_map
return
final_prop_map
security
.
declareProtected
(
Permissions
.
ManagePortal
,
'export'
)
def
export
(
self
,
path
=
None
,
local
=
0
,
bma
=
None
,
**
kw
):
def
export
(
self
,
path
=
None
,
local
=
0
,
bma
=
None
,
**
kw
):
"""
"""
Export the object
Export the object as zexp file
XXX: Are we planning to use something like archive for saving the exported
objects inside a Business Manager
"""
"""
if
not
self
.
getStatus
()
==
'built'
:
if
not
self
.
getStatus
()
==
'built'
:
raise
ValueError
,
'Manager not built properly'
raise
ValueError
,
'Manager not built properly'
f
=
StringIO
()
f
=
StringIO
()
self
.
_p_jar
.
exportFile
(
self
.
_p_oid
,
f
)
self
.
_p_jar
.
exportFile
(
self
.
_p_oid
,
f
)
# XXX: Improve naming
# XXX: Improve naming
...
@@ -277,7 +278,7 @@ class BusinessManager(XMLObject):
...
@@ -277,7 +278,7 @@ class BusinessManager(XMLObject):
connection
=
self
.
aq_parent
.
_p_jar
connection
=
self
.
aq_parent
.
_p_jar
file
=
open
(
path
,
'rb'
)
file
=
open
(
path
,
'rb'
)
obj
=
connection
.
importFile
(
file
)
obj
=
connection
.
importFile
(
file
)
self
.
_path_item_list
=
obj
.
_path_item_list
self
.
_path_item_list
=
obj
.
_path_item_list
[:]
self
.
_setTemplatePathList
(
obj
.
getTemplatePathList
())
self
.
_setTemplatePathList
(
obj
.
getTemplatePathList
())
def
__add__
(
self
,
other
):
def
__add__
(
self
,
other
):
...
@@ -319,7 +320,7 @@ class BusinessManager(XMLObject):
...
@@ -319,7 +320,7 @@ class BusinessManager(XMLObject):
"""
"""
portal
=
self
.
getPortalObject
()
portal
=
self
.
getPortalObject
()
LOG
(
'Business Manager'
,
INFO
,
'Storing Manager Data'
)
LOG
(
'Business Manager'
,
INFO
,
'Storing Manager Data'
)
self
.
_path_item_list
=
[]
self
.
_path_item_list
=
PersistentList
()
path_item_list
=
self
.
getTemplatePathList
()
path_item_list
=
self
.
getTemplatePathList
()
if
path_item_list
:
if
path_item_list
:
...
...
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