Commit f250fed9 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Prevent the generation of duplicated methods.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@1886 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4c424623
...@@ -899,6 +899,8 @@ def setDefaultProperties(klass, object=None): ...@@ -899,6 +899,8 @@ def setDefaultProperties(klass, object=None):
converted_prop_keys = {} converted_prop_keys = {}
for prop in prop_list: for prop in prop_list:
if prop['type'] in legalTypes: if prop['type'] in legalTypes:
if 'base_id' in prop:
continue
if not converted_prop_keys.has_key(prop['id']): if not converted_prop_keys.has_key(prop['id']):
if prop['type'] != 'content': converted_prop_list += [prop] if prop['type'] != 'content': converted_prop_list += [prop]
converted_prop_keys[prop['id']] = 1 converted_prop_keys[prop['id']] = 1
...@@ -936,12 +938,14 @@ def setDefaultProperties(klass, object=None): ...@@ -936,12 +938,14 @@ def setDefaultProperties(klass, object=None):
new_prop = prop.copy() new_prop = prop.copy()
if prop['type'] in list_types or prop.get('multivalued', 0): if prop['type'] in list_types or prop.get('multivalued', 0):
# Display as list # Display as list
if not prop.get('base_id', None):
new_prop['base_id'] = prop['id'] new_prop['base_id'] = prop['id']
new_prop['id'] = prop['id'] + '_list' new_prop['id'] = prop['id'] + '_list'
if prop.has_key('acquisition_base_category') and not prop.get('acquisition_copy_value'): if prop.has_key('acquisition_base_category') and not prop.get('acquisition_copy_value'):
# Set acquisition values as read only if no value is copied # Set acquisition values as read only if no value is copied
new_prop['mode'] = 'r' new_prop['mode'] = 'r'
new_converted_prop_list += [new_prop] new_converted_prop_list += [new_prop]
#LOG('setDefaultProperties', 0, 'klass = %r, object = %r, converted_prop_list = %r, new_converted_prop_list = %r' % (klass, object, converted_prop_list, new_converted_prop_list))
# Set the properties of the class # Set the properties of the class
klass._properties = tuple(new_converted_prop_list) klass._properties = tuple(new_converted_prop_list)
klass._categories = tuple(cat_list) klass._categories = tuple(cat_list)
......
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