Commit 9d46973e authored by Arnaud Fontaine's avatar Arnaud Fontaine

erp5_autocompletion_ui: Autocompletion property value set to the field should...

erp5_autocompletion_ui: Autocompletion property value set to the field should be the one queried from the Catalog.
parent 7582ea77
...@@ -51,7 +51,6 @@ ...@@ -51,7 +51,6 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>return {\'label\': obj.getTitle(),\n <value> <string>return {\'label\': obj.getTitle(),\n
\'value\': obj.getTitle(),\n
\'description\': obj.getRelativeUrl()}\n \'description\': obj.getRelativeUrl()}\n
</string> </value> </string> </value>
</item> </item>
......
...@@ -63,10 +63,12 @@ for brain in context.portal_catalog(**kw):\n ...@@ -63,10 +63,12 @@ for brain in context.portal_catalog(**kw):\n
obj = brain.getObject()\n obj = brain.getObject()\n
\n \n
# There may be objects with different Portal Types, so the only way seems\n # There may be objects with different Portal Types, so the only way seems\n
# to call the script for each object...\n # to call the script for each object... The returned dict should only contains\n
# \'label\' (first line displayed) and \'description\' (optional: second line displayed)\n
result_dict = obj.getTypeBasedMethod(\'getCompletionDict\',\n result_dict = obj.getTypeBasedMethod(\'getCompletionDict\',\n
fallback_script_id=\'Base_getCompletionDict\')(obj)\n fallback_script_id=\'Base_getCompletionDict\')(obj)\n
\n \n
result_dict[\'value\'] = obj.getProperty(search_catalog_key)\n
result_dict_list.append(result_dict)\n result_dict_list.append(result_dict)\n
\n \n
from json import dumps\n from json import dumps\n
......
2014-02-07 arnaud.fontaine
* Autocompletion property value set to the field should be the one queried from the Catalog.
2014-02-07 arnaud.fontaine 2014-02-07 arnaud.fontaine
* Consider that description may not be needed, thus only one line, the label, is displayed. * Consider that description may not be needed, thus only one line, the label, is displayed.
......
16 17
\ No newline at end of file \ No newline at end of file
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