parameters: (self, field, key)
return_statement: return """
  <script type="text/javascript">
  $(document).ready(function() {
    $("input[name='%s']").ERP5Autocomplete({search_portal_type: %s,
                                            search_catalog_key: "%s"});
  });
  </script>""" % (
        escape(key),
        escape(json.dumps([x[0] for x in field.get_value('portal_type')])),
        escape(field.get_value('catalog_index')),
      )
docstring: Use jquery-ui autocompletion for all relation fields by default, requiring
      only erp5_autocompletion_ui bt5 to be installed
docstring_summary: Use jquery-ui autocompletion for all relation fields by default, requiring
      only erp5_autocompletion_ui bt5 to be installed
docstring_tokens: Use jquery - ui autocompletion for all relation fields by default requiring only erp5_autocompletion_ui bt5 to be installed
function: def render_autocomplete(self, field, key):
      """
      Use jquery-ui autocompletion for all relation fields by default, requiring
      only erp5_autocompletion_ui bt5 to be installed
      """
      # XXX: Allow to specify more parameters to jquery-ui autocomplete widget?
      return """
  <script type="text/javascript">
  $(document).ready(function() {
    $("input[name='%s']").ERP5Autocomplete({search_portal_type: %s,
                                            search_catalog_key: "%s"});
  });
  </script>""" % (
        escape(key),
        escape(json.dumps([x[0] for x in field.get_value('portal_type')])),
        escape(field.get_value('catalog_index')),
      )
function_tokens: def render_autocomplete ( self , field , key ) : # XXX: Allow to specify more parameters to jquery-ui autocomplete widget? return """
  <script type="text/javascript">
  $(document).ready(function() {
    $("input[name='%s']").ERP5Autocomplete({search_portal_type: %s,
                                            search_catalog_key: "%s"});
  });
  </script>""" % ( escape ( key ) , escape ( json . dumps ( [ x [ 0 ] for x in field . get_value ( 'portal_type' ) ] ) ) , escape ( field . get_value ( 'catalog_index' ) ) , )