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
c426efb9
Commit
c426efb9
authored
Jun 30, 2016
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_catalog: Naming changes in migrateSQLCatalogToERP5Catalog as per context of the function
parent
658dd8de
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
product/ERP5/ERP5Site.py
product/ERP5/ERP5Site.py
+15
-15
No files found.
product/ERP5/ERP5Site.py
View file @
c426efb9
...
...
@@ -1704,7 +1704,7 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
# Getting ERP5 Catalog Tool
catalog_tool
=
self
.
portal_catalog
sql_catalog
=
catalog_tool
.
getSQLCatalog
()
new
_id
=
'erp5_mysql_innodb_new'
erp5_catalog
_id
=
'erp5_mysql_innodb_new'
# If there is no default SQL Catalog installed already, add a warning log
# in ERP5Site and break the migration
if
not
sql_catalog
:
...
...
@@ -1714,15 +1714,15 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
return
if
not
isinstance
(
sql_catalog
,
ERP5Catalog
):
if
new
_id
not
in
catalog_tool
.
objectIds
():
if
erp5_catalog
_id
not
in
catalog_tool
.
objectIds
():
# Create new ERP5Catalog object if it doesn't exist
catalog_tool
.
manage_addProduct
[
'ERP5Catalog'
].
manage_addERP5Catalog
(
id
=
new
_id
,
id
=
erp5_catalog
_id
,
title
=
''
)
new_erp5_catalog
=
catalog_tool
.
_getOb
(
new
_id
)
erp5_catalog
=
catalog_tool
.
_getOb
(
erp5_catalog
_id
)
# No need to migrate if the
new_
erp5_catalog is not an object of ERP5Catlog
if
not
isinstance
(
new_
erp5_catalog
,
ERP5Catalog
):
# No need to migrate if the erp5_catalog is not an object of ERP5Catlog
if
not
isinstance
(
erp5_catalog
,
ERP5Catalog
):
return
# Copy-paste objects from SQLCatalog to ERP5Catalog
...
...
@@ -1730,14 +1730,14 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
ob
=
sql_catalog
.
_getOb
(
id
)
# Check if the object is copyable and that it doesn't already exist
# The copying attributes are from OFS.CopySupport
if
hasattr
(
ob
,
'_canCopy'
)
and
not
new_
erp5_catalog
.
has_key
(
id
):
# Get a copy of object for new conainer, i.e.
new_
erp5_catalog
ob
=
ob
.
_getCopy
(
new_
erp5_catalog
)
if
hasattr
(
ob
,
'_canCopy'
)
and
not
erp5_catalog
.
has_key
(
id
):
# Get a copy of object for new conainer, i.e. erp5_catalog
ob
=
ob
.
_getCopy
(
erp5_catalog
)
ob
.
_setId
(
id
)
# Set the copied object in the
new_
erp5_catalog
new_
erp5_catalog
.
_setObject
(
id
,
ob
)
ob
=
new_
erp5_catalog
.
_getOb
(
id
)
ob
.
_postCopy
(
new_
erp5_catalog
,
op
=
0
)
# Set the copied object in the erp5_catalog
erp5_catalog
.
_setObject
(
id
,
ob
)
ob
=
erp5_catalog
.
_getOb
(
id
)
ob
.
_postCopy
(
erp5_catalog
,
op
=
0
)
# Update properties list for the new catalog from the SQLCatalog
# Not an efficient way to carry this
...
...
@@ -1747,11 +1747,11 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
# https://lab.nexedi.com/nexedi/erp5/blob/198df7021a17725e81ab930015c3c618e94263db/product/ERP5Type/Base.py#L3531
if
not
property_id
==
'title'
:
value
=
getattr
(
sql_catalog
,
property_id
)
new_
erp5_catalog
.
_updateProperty
(
id
=
property_id
,
value
=
value
)
erp5_catalog
.
_updateProperty
(
id
=
property_id
,
value
=
value
)
# Update default erp5 catalog id, everytime we run migration
# ERP5 Catalog(basically when this fucntion is called while creating ERP5Site)
catalog_tool
.
default_erp5_catalog_id
=
new
_id
catalog_tool
.
default_erp5_catalog_id
=
erp5_catalog
_id
Globals
.
InitializeClass
(
ERP5Site
)
...
...
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