Commit 020b31a9 authored by Nicolas Dumazet's avatar Nicolas Dumazet

use Base Type objects instead of manage_addTypeInformation


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@38686 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent fcb2924e
...@@ -400,13 +400,12 @@ class ManageModule: ...@@ -400,13 +400,12 @@ class ManageModule:
set portal_type for the module containing objects. set portal_type for the module containing objects.
returns nothing returns nothing
""" """
portal_types.manage_addTypeInformation('ERP5 Type Information' module_portal_type_value = portal_types.newContent(
, typeinfo_name = 'ERP5Type: ERP5 Folder' id=module_portal_type,
, id = module_portal_type) portal_type='Base Type')
# getting portal_type access to be able to modify attributes
module_portal_type_value = portal_types[module_portal_type]
# set allowed content type # set allowed content type
module_portal_type_value.edit( module_portal_type_value.edit(
type_factory_method_id='addFolder',
type_allowed_content_type_list=(object_portal_type_id,), type_allowed_content_type_list=(object_portal_type_id,),
type_filter_content_type=1) type_filter_content_type=1)
# adding usefull actions (in our case the view action) # adding usefull actions (in our case the view action)
...@@ -426,16 +425,18 @@ class ManageModule: ...@@ -426,16 +425,18 @@ class ManageModule:
object_names): object_names):
name = '' name = ''
if def_usePropertySheet: if def_usePropertySheet:
# XXX this should get easier with portal type classes
# generating 'typeinfo_name' property for the new portal type. # generating 'typeinfo_name' property for the new portal type.
# if class exists, then using it, otherwize using default ERP5 # if class exists, then using it, otherwize using default ERP5
# Document type. # Document type.
name = 'ERP5Type: ERP5 ' + object_portal_type # use with PropertySheet name = 'add' + object_portal_type # use with PropertySheet
else: else:
name = 'ERP5Type: ERP5 Document' # use with local properties name = 'addDocument' # use with local properties
portal_types.manage_addTypeInformation( 'ERP5 Type Information', object_portal_type_value = portal_types.newContent(
typeinfo_name = name, type_factory_method_id=name,
id = object_portal_type_id) id=object_portal_type_id,
object_portal_type_value = portal_types[object_portal_type_id] portal_type='Base Type')
# adding usefull actions (in our case the view action) # adding usefull actions (in our case the view action)
object_portal_type_value.newContent(portal_type='Action Information', object_portal_type_value.newContent(portal_type='Action Information',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment