Commit 7d085af3 authored by Romain Courteaud's avatar Romain Courteaud

Enable possibility to validate the relation by clicking on the wheel without value in the field.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2477 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent fa76ec95
......@@ -342,7 +342,10 @@ class MultiRelationStringFieldValidator(Validator.LinesValidator, RelationField
catalog_index = field.get_value('catalog_index')
relation_setter_id = field.get_value('relation_setter_id')
if checkSameKeys( value_list, current_value_list ):
relation_field_id = 'relation_%s' % ( key )
# we must know if user validate the form or click on the wheel button
relation_uid_list = REQUEST.get(relation_field_id, None)
if checkSameKeys( value_list, current_value_list ) and (relation_uid_list is None):
# XXX Will be interpreted by Base_edit as "do nothing"
#return MultiRelationEditor(field.id, base_category, portal_type, portal_type_item, catalog_index, relation_setter_id, None)
return None
......
......@@ -316,7 +316,8 @@ class RelationStringFieldValidator(Validator.StringValidator):
parameter_list = field.get_value('parameter_list')
relation_setter_id = field.get_value('relation_setter_id')
if value == current_value:
if (value == current_value) and (relation_uid is None):
LOG('RelationStringFieldValidator, validate',0,'Same value, but relation_uid: %s' % str(relation_uid) )
return None
# XXX return RelationEditor(key, base_category, portal_type, None,
# portal_type_item, catalog_index, value, relation_setter_id, None)
......
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