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
a34f7caa
Commit
a34f7caa
authored
Jan 24, 2017
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bt5_prototype: Update Business Package to use ObjectPropertyTemplateItem
parent
60ebe529
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
9 deletions
+14
-9
product/ERP5/Document/BusinessPackage.py
product/ERP5/Document/BusinessPackage.py
+14
-9
No files found.
product/ERP5/Document/BusinessPackage.py
View file @
a34f7caa
...
...
@@ -142,7 +142,7 @@ class BusinessPackage(XMLObject):
def
_install
(
self
,
**
kw
):
self
.
_path_item
.
install
(
self
)
#
self._object_property_item.install(self)
self
.
_object_property_item
.
install
(
self
)
security
.
declareProtected
(
Permissions
.
ManagePortal
,
'install'
)
install
=
_install
...
...
@@ -158,16 +158,16 @@ class BusinessPackage(XMLObject):
"""
if
not
no_action
:
self
.
storePathData
()
# XXX: Explicitly calling build for items. Needs to be changed
self
.
_path_item
.
build
(
self
)
self
.
_object_property_item
.
build
(
self
)
pass
#self._object_property_item.build(self)
#self.setBuildingState('built')
security
.
declareProtected
(
Permissions
.
ManagePortal
,
'storePathData'
)
def
storePathData
(
self
):
self
.
_path_item
=
PathTemplatePackageItem
(
self
.
_getTemplatePathList
())
#
self._object_property_item = \
#
ObjectPropertyTemplatePackageItem(self._getTemplateObjectPropertyList())
self
.
_object_property_item
=
\
ObjectPropertyTemplatePackageItem
(
self
.
_getTemplateObjectPropertyList
())
security
.
declareProtected
(
Permissions
.
ManagePortal
,
'getTemplatePathList'
)
def
_getTemplateObjectPropertyList
(
self
):
...
...
@@ -220,7 +220,7 @@ class BusinessPackage(XMLObject):
elif
prop_type
in
(
'lines'
,
'tokens'
):
bpa
.
addObject
(
'
\
n
'
.
join
(
value
),
name
=
id
,
path
=
'bt'
,
ext
=
''
)
item_name_list
=
[
'_path_item'
,]
item_name_list
=
[
'_path_item'
,
'_object_property_item'
]
# Export each part
for
item_name
in
item_name_list
:
item
=
getattr
(
self
,
item_name
,
None
)
...
...
@@ -250,10 +250,12 @@ class BusinessPackage(XMLObject):
prop_dict
[
pid
]
=
value
or
0
elif
prop_type
in
(
'lines'
,
'tokens'
):
prop_dict
[
pid
[:
-
5
]]
=
(
value
or
''
).
splitlines
()
# XXX: This is not working, needs to be fixed so as it copies all the
# properties from BPA to the newly created Business Package
self
.
_edit
(
**
prop_dict
)
self
.
storePathData
()
item_name_list
=
[
'_path_item'
,]
item_name_list
=
[
'_path_item'
,
'_object_property_item'
]
for
item_name
in
item_name_list
:
item_object
=
getattr
(
self
,
item_name
,
None
)
# this check is due to backwards compatability when there can be a
...
...
@@ -726,8 +728,8 @@ class PathTemplatePackageItem(Implicit, Persistent):
if
getattr
(
aq_base
(
obj
),
'reindexObject'
,
None
)
is
not
None
:
obj
.
reindexObject
()
def
importFile
(
self
,
b
t
a
,
**
kw
):
b
t
a
.
importFiles
(
self
)
def
importFile
(
self
,
b
p
a
,
**
kw
):
b
p
a
.
importFiles
(
self
)
def
_importFile
(
self
,
file_name
,
file_obj
,
catalog_method_template_item
=
0
):
obj_key
,
file_ext
=
os
.
path
.
splitext
(
file_name
)
...
...
@@ -882,6 +884,9 @@ class ObjectPropertyTemplatePackageItem(Implicit, Persistent):
xml_data
=
self
.
generateXml
()
bpa
.
addObject
(
xml_data
,
name
=
self
.
xml_tag
,
path
=
path
)
def
importFile
(
self
,
bpa
,
**
kw
):
bpa
.
importFiles
(
self
)
def
_importFile
(
self
,
file_name
,
file
):
if
not
file_name
.
endswith
(
'.xml'
):
LOG
(
'Business Template'
,
0
,
'Skipping file "%s"'
%
(
file_name
,
))
...
...
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