Commit fa76ec95 authored by Romain Courteaud's avatar Romain Courteaud

Reuse _setValueUids, because it takes portal_type as parameter (needed when on...

Reuse _setValueUids, because it takes portal_type as parameter (needed when on a Form, there are 2 RelationField with the same base_category)


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2476 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7ea27d18
......@@ -278,14 +278,16 @@ class MultiRelationEditor:
relation_setter((), portal_type=self.portal_type)
relation_setter( relation_uid_list , portal_type=self.portal_type)
else:
if relation_uid_list == []:
# XXX we could call a generic method which create the setter method name
set_method_name = '_set'+convertToUpperCase(self.base_category)
getattr(o, set_method_name)( None )
else:
# XXX we could call a generic method which create the setter method name
set_method_name = '_set'+convertToUpperCase(self.base_category)+'ValueList'
getattr(o, set_method_name)( relation_object_list )
# if relation_uid_list == []:
# # XXX we could call a generic method which create the setter method name
# set_method_name = '_set'+convertToUpperCase(self.base_category)
# getattr(o, set_method_name)( None )
# else:
# # XXX we could call a generic method which create the setter method name
# set_method_name = '_set'+convertToUpperCase(self.base_category)+'ValueList'
# getattr(o, set_method_name)( relation_object_list )
o._setValueUids(self.base_category, (), portal_type=self.portal_type)
o._setValueUids(self.base_category, relation_uid_list, portal_type=self.portal_type)
else:
# Nothing to do
......
......@@ -263,10 +263,12 @@ class RelationEditor:
relation_setter((), portal_type=self.portal_type)
relation_setter((int(self.uid),), portal_type=self.portal_type)
else:
# XXX we could call a generic method which create the setter method name
set_method_name = '_set'+convertToUpperCase(self.base_category)+'Value'
object = o.portal_catalog.getObject( self.uid )
getattr(o, set_method_name)( object )
# # XXX we could call a generic method which create the setter method name
# set_method_name = '_set'+convertToUpperCase(self.base_category)+'Value'
# object = o.portal_catalog.getObject( self.uid )
# getattr(o, set_method_name)( object )
o._setValueUids(self.base_category, (), portal_type=self.portal_type)
o._setValueUids(self.base_category, (int(self.uid),), portal_type=self.portal_type)
else:
if self.value == '':
......@@ -275,9 +277,10 @@ class RelationEditor:
relation_setter = getattr(o, self.relation_setter_id)
relation_setter((), portal_type=self.portal_type)
else:
# XXX we could call a generic method which create the setter method name
set_method_name = '_set'+convertToUpperCase(self.base_category)
getattr(o, set_method_name)( None )
# # XXX we could call a generic method which create the setter method name
# set_method_name = '_set'+convertToUpperCase(self.base_category)
# getattr(o, set_method_name)( None )
o._setValueUids(self.base_category, (), portal_type=self.portal_type)
allow_class(RelationEditor)
......
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