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
1
Issues
1
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
Roque
erp5
Commits
16c75d2c
Commit
16c75d2c
authored
Feb 19, 2014
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Type: Support for Zope 2.8 has been dropped so set() can now be used without problem.
parent
6c0eae95
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
23 additions
and
13 deletions
+23
-13
bt5/erp5_ooo_import/SkinTemplateItem/portal_skins/erp5_ooo_import/Base_getModulePortalTypeDefaultProperty.xml
...p5_ooo_import/Base_getModulePortalTypeDefaultProperty.xml
+1
-1
bt5/erp5_ooo_import/SkinTemplateItem/portal_skins/erp5_ooo_import/Base_getModulePortalTypeSortedPropertyList.xml
...ooo_import/Base_getModulePortalTypeSortedPropertyList.xml
+1
-1
bt5/erp5_ooo_import/bt/change_log
bt5/erp5_ooo_import/bt/change_log
+3
-0
bt5/erp5_ooo_import/bt/revision
bt5/erp5_ooo_import/bt/revision
+1
-1
product/ERP5Type/ERP5Type.py
product/ERP5Type/ERP5Type.py
+11
-4
product/ERP5Type/dynamic/lazy_class.py
product/ERP5Type/dynamic/lazy_class.py
+1
-1
product/ERP5Type/tests/testERP5Type.py
product/ERP5Type/tests/testERP5Type.py
+5
-5
No files found.
bt5/erp5_ooo_import/SkinTemplateItem/portal_skins/erp5_ooo_import/Base_getModulePortalTypeDefaultProperty.xml
View file @
16c75d2c
...
...
@@ -72,7 +72,7 @@ if spreadsheet_column is None:\n
return \'\'\n
spreadsheet_column_property_list = extract_keyword(spreadsheet_column)\n
for portal_type in module.allowedContentTypes():\n
for property in portal_type.getInstancePropertyAndBaseCategory
Lis
t():\n
for property in portal_type.getInstancePropertyAndBaseCategory
Se
t():\n
if property not in forbidden_property:\n
property_dict = {}\n
key = \'%s.%s\' % (portal_type.id, property)\n
...
...
bt5/erp5_ooo_import/SkinTemplateItem/portal_skins/erp5_ooo_import/Base_getModulePortalTypeSortedPropertyList.xml
View file @
16c75d2c
...
...
@@ -56,7 +56,7 @@ forbidden_property = [\'uid\', \'portal_type\']\n
property_list = []\n
\n
for portal_type in module.allowedContentTypes():\n
for property in portal_type.getInstancePropertyAndBaseCategory
Lis
t():\n
for property in portal_type.getInstancePropertyAndBaseCategory
Se
t():\n
if property not in forbidden_property:\n
property_list.append((portal_type.id, property))\n
\n
...
...
bt5/erp5_ooo_import/bt/change_log
View file @
16c75d2c
2014-02-19 Arnaud Fontaine
* Support for Zope 2.8 has been dropped so set() can now be used without problem.
2009-04-18 Kazuhiko
* Version 5.4.1
...
...
bt5/erp5_ooo_import/bt/revision
View file @
16c75d2c
412
\ No newline at end of file
413
\ No newline at end of file
product/ERP5Type/ERP5Type.py
View file @
16c75d2c
...
...
@@ -512,8 +512,8 @@ class ERP5TypeInformation(XMLObject,
return
list
(
self
.
_getPropertyHolder
().
_categories
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getInstancePropertyAndBaseCategory
Lis
t'
)
def
getInstancePropertyAndBaseCategory
Lis
t
(
self
):
'getInstancePropertyAndBaseCategory
Se
t'
)
def
getInstancePropertyAndBaseCategory
Se
t
(
self
):
"""Return all the properties and base categories of the portal type. """
# XXX: Hack until introspection methods are defined. At least, this works
# for portal_type whose properties are defined dynamically
...
...
@@ -530,8 +530,15 @@ class ERP5TypeInformation(XMLObject,
for
category
in
cls
.
_categories
:
return_set
.
add
(
category
)
return_set
.
add
(
category
+
'_free_text'
)
# XXX Can't return set to restricted code in Zope 2.8.
return
list
(
return_set
)
return
return_set
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getInstancePropertyAndBaseCategoryList'
)
@
deprecated
(
'getInstancePropertyAndBaseCategoryList is deprecated '
'in favor of getInstancePropertyAndBaseCategorySet'
)
def
getInstancePropertyAndBaseCategoryList
(
self
):
"""Return all the properties and base categories of the portal type"""
return
list
(
self
.
getInstancePropertyAndBaseCategorySet
())
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getInstancePropertyMap'
)
...
...
product/ERP5Type/dynamic/lazy_class.py
View file @
16c75d2c
...
...
@@ -167,7 +167,7 @@ class PortalTypeMetaClass(GhostBaseMetaClass, PropertyHolder):
Properties whose type is 'content' should not be visible in ZMI
so they are not returned by default. This would also slow down
MovementCollectionDiff._getPropertyList (ERP5 product). However,
ERP5TypeInformation.getInstancePropertyAndBaseCategory
Lis
t needs them.
ERP5TypeInformation.getInstancePropertyAndBaseCategory
Se
t needs them.
@see Products.ERP5Type.Base.Base._propertyMap
"""
...
...
product/ERP5Type/tests/testERP5Type.py
View file @
16c75d2c
...
...
@@ -3088,18 +3088,18 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
self
.
assertEqual
(
None
,
person
.
getProperty
(
'foo_property'
))
self
.
assertEqual
(
None
,
person
.
getProperty
(
'foobar_property'
))
def
test_getInstancePropertyAndBaseCategory
Lis
t
(
self
):
def
test_getInstancePropertyAndBaseCategory
Se
t
(
self
):
"""
Check that the method getInstancePropertyAndBaseCategory
Lis
t return
Check that the method getInstancePropertyAndBaseCategory
Se
t return
properties from property sheets correctly
"""
portal_type
=
self
.
portal
.
portal_types
.
Person
result_
list
=
portal_type
.
getInstancePropertyAndBaseCategoryLis
t
()
result_
set
=
portal_type
.
getInstancePropertyAndBaseCategorySe
t
()
# Test a simple property, an acquired one on and a category.
for
x
in
"id"
,
"address_city"
,
"function"
:
self
.
assertTrue
(
x
in
result_
list
,
"%s not in %s"
%
(
x
,
result_lis
t
))
self
.
assertTrue
(
x
in
result_
set
,
"%s not in %s"
%
(
x
,
result_se
t
))
# Values from which acquired properties are fetched are not returned.
self
.
assertFalse
(
"address"
in
result_
lis
t
)
self
.
assertFalse
(
"address"
in
result_
se
t
)
class
TestAccessControl
(
ERP5TypeTestCase
):
...
...
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