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
feef636c
Commit
feef636c
authored
Jul 06, 2016
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_catalog: Create portal_type dynamic object for new erp5_catalog object while migration
parent
e7a47e6c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
product/ERP5/ERP5Site.py
product/ERP5/ERP5Site.py
+6
-4
No files found.
product/ERP5/ERP5Site.py
View file @
feef636c
...
@@ -1716,9 +1716,9 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
...
@@ -1716,9 +1716,9 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
if
not
isinstance
(
sql_catalog
,
ERP5Catalog
):
if
not
isinstance
(
sql_catalog
,
ERP5Catalog
):
if
erp5_catalog_id
not
in
catalog_tool
.
objectIds
():
if
erp5_catalog_id
not
in
catalog_tool
.
objectIds
():
# Create new ERP5Catalog object if it doesn't exist
# Create new ERP5Catalog object if it doesn't exist
catalog_tool
.
manage_addProduct
[
'ERP5Catalog'
].
manage_addERP5Catalog
(
catalog_tool
.
newContent
(
portal_type
=
'Catalog'
,
id
=
erp5_catalog_id
,
id
=
erp5_catalog_id
,
title
=
''
)
title
=
''
)
# Update default erp5 catalog id, the first time we run create ..
# Update default erp5 catalog id, the first time we run create ..
# ERP5Catalog object.
# ERP5Catalog object.
catalog_tool
.
default_erp5_catalog_id
=
erp5_catalog_id
catalog_tool
.
default_erp5_catalog_id
=
erp5_catalog_id
...
@@ -1745,6 +1745,7 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
...
@@ -1745,6 +1745,7 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
# Update properties list for the new catalog from the SQLCatalog
# Update properties list for the new catalog from the SQLCatalog
# Not an efficient way to carry this
# Not an efficient way to carry this
for
property_id
in
sql_catalog
.
propertyIds
():
for
property_id
in
sql_catalog
.
propertyIds
():
#import pdb; pdb.set_trace()
# This is needed because there have been problems with setting property
# This is needed because there have been problems with setting property
# for title, see this docstring for explanations:
# for title, see this docstring for explanations:
# https://lab.nexedi.com/nexedi/erp5/blob/198df7021a17725e81ab930015c3c618e94263db/product/ERP5Type/Base.py#L3531
# https://lab.nexedi.com/nexedi/erp5/blob/198df7021a17725e81ab930015c3c618e94263db/product/ERP5Type/Base.py#L3531
...
@@ -2290,6 +2291,7 @@ class ERP5Generator(PortalGenerator):
...
@@ -2290,6 +2291,7 @@ class ERP5Generator(PortalGenerator):
addERP5Tool
(
p
,
'portal_activities'
,
'Activity Tool'
)
addERP5Tool
(
p
,
'portal_activities'
,
'Activity Tool'
)
# CatalogTool has been included inside ERP5. So, prefer using addERP5Tool
# CatalogTool has been included inside ERP5. So, prefer using addERP5Tool
# instead of using addTool on Catalog Tool object.
# instead of using addTool on Catalog Tool object.
addERP5Tool
(
p
,
'portal_catalog'
,
'Catalog Tool'
)
addERP5Tool
(
p
,
'portal_catalog'
,
'Catalog Tool'
)
# Initialize Activities
# Initialize Activities
p
.
portal_activities
.
manageClearActivities
()
p
.
portal_activities
.
manageClearActivities
()
...
@@ -2302,7 +2304,7 @@ class ERP5Generator(PortalGenerator):
...
@@ -2302,7 +2304,7 @@ class ERP5Generator(PortalGenerator):
if
not
p
.
hasObject
(
'content_type_registry'
):
if
not
p
.
hasObject
(
'content_type_registry'
):
self
.
setupMimetypes
(
p
)
self
.
setupMimetypes
(
p
)
#import pdb; pdb.set_trace()
if
not
update
:
if
not
update
:
self
.
setupWorkflow
(
p
)
self
.
setupWorkflow
(
p
)
self
.
setupERP5Core
(
p
,
**
kw
)
self
.
setupERP5Core
(
p
,
**
kw
)
...
...
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