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
400de71c
Commit
400de71c
authored
Jul 11, 2016
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_catalog: Update properties for ERP5Catalog object with same values as SQLCatalog objects
parent
92f42a9b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
product/ERP5/ERP5Site.py
product/ERP5/ERP5Site.py
+19
-0
No files found.
product/ERP5/ERP5Site.py
View file @
400de71c
...
...
@@ -34,6 +34,7 @@ from Products.ERP5Type.Cache import caching_instance_method
from
Products.ERP5Type.Cache
import
CachingMethod
,
CacheCookieMixin
from
Products.ERP5Type.ERP5Type
import
ERP5TypeInformation
from
Products.ERP5Type.Log
import
log
as
unrestrictedLog
from
Products.ERP5Type.Utils
import
UpperCase
from
Products.CMFActivity.Errors
import
ActivityPendingError
import
ERP5Defaults
from
Products.ERP5Type.TransactionalVariable
import
getTransactionalVariable
...
...
@@ -1755,6 +1756,24 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
property_type
=
sql_catalog
.
getPropertyType
(
property_id
)
erp5_catalog
.
setProperty
(
key
=
property_id
,
value
=
value
,
type
=
property_type
)
# This step is required as we don't have consistency between the properties
# of new ERP5Catalog object and SQLCatalog.Catalog objects, i.e,
# for example: Trying to get property `sql_catalog_clear_reserved` for
# `erp5_catalog` would give us a tuple cause it is basically calling the
# getter function getSqlCatalogClearReserved, which when called for
# `sql_catalog.sql_catalog_clear_reserved` would give a string.
# This inconsistency arised due to the generation of getter functions where
# 'selection' type is taken as list_types which leads to creating getters
# and setters accordingly to create list and tuples instead of just a
# string. Well, imo(Ayush), this might not be good way to solve this
# problem. Other way would be to leave the proeprties as it is for ERP5Catalog
# objects and change the function calls in ERP5Catalog accordignly instead.
for
p
in
sql_catalog
.
propertyMap
():
if
p
[
'type'
]
==
'selection'
:
accessor_name
=
'get'
+
UpperCase
(
p
[
'id'
])
value
=
getattr
(
sql_catalog
,
p
[
'id'
])
setattr
(
erp5_catalog
,
p
[
'id'
],
value
)
Globals
.
InitializeClass
(
ERP5Site
)
def
getBootstrapDirectory
():
...
...
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