Commit 9f601c1f authored by Jean-Paul Smets's avatar Jean-Paul Smets

Use new API to set Uids (getValueUidList / setValueUidList)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10024 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9138a704
...@@ -172,7 +172,7 @@ try:\n ...@@ -172,7 +172,7 @@ try:\n
request.set(\'portal_type\', portal_type)\n request.set(\'portal_type\', portal_type)\n
request.set(my_field.get_value(\'catalog_index\'), new_value)\n request.set(my_field.get_value(\'catalog_index\'), new_value)\n
request.set(\'field_id\', my_field.id)\n request.set(\'field_id\', my_field.id)\n
previous_uids = o.getValueUids(base_category, portal_type=portal_type)\n previous_uids = o.getValueUidList(base_category, portal_type=portal_type)\n
relation_list = context.portal_catalog(**kw)\n relation_list = context.portal_catalog(**kw)\n
relation_uid_list = map(lambda x: x.uid, relation_list)\n relation_uid_list = map(lambda x: x.uid, relation_list)\n
uids = []\n uids = []\n
...@@ -182,7 +182,7 @@ try:\n ...@@ -182,7 +182,7 @@ try:\n
context.portal_selections.setSelectionCheckedUidsFor(\'Base_viewRelatedObjectList\', uids)\n context.portal_selections.setSelectionCheckedUidsFor(\'Base_viewRelatedObjectList\', uids)\n
if len(new_value) == 0:\n if len(new_value) == 0:\n
# Clear the relation\n # Clear the relation\n
o.setValueUids(base_category, (), portal_type=portal_type)\n o.setValueUidList(base_category, (), portal_type=portal_type)\n
elif same_keys:\n elif same_keys:\n
uids = getOrderedUids(uids, new_value, my_field.get_value(\'catalog_index\'))\n uids = getOrderedUids(uids, new_value, my_field.get_value(\'catalog_index\'))\n
return o.Base_editRelation( form_id,\n return o.Base_editRelation( form_id,\n
......
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