diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/ListBox_asHTML.xml b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/ListBox_asHTML.xml index 90fe2cb7f73419d3f8398882d94334cca2356f65..42e19da301df9c63f6df2a96794c621987f689ff 100644 --- a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/ListBox_asHTML.xml +++ b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/ListBox_asHTML.xml @@ -503,6 +503,8 @@ <span i18n:translate="" i18n:domain="ui">\n No result.\n </span>\n + <input type="hidden" value="1" name="listbox_empty:boolean"\n + tal:attributes="name string:${field_prefix}${field_id}_empty:boolean" />\n </td>\n </tr>\n </tbody>\n diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision b/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision index 87b98496d9677897f03e0d6f8b216e69e05c69d7..b29e8d2b2be279ea7c2e24283d29ecb956f7a1bd 100644 --- a/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision +++ b/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision @@ -1 +1 @@ -1089 \ No newline at end of file +1090 \ No newline at end of file diff --git a/product/ERP5Form/ListBox.py b/product/ERP5Form/ListBox.py index 089017a2367b24afea0c2e424f683b1006bd89ad..bc84c6c5fcc636b1bb4755c5d154acdc7b76a0aa 100644 --- a/product/ERP5Form/ListBox.py +++ b/product/ERP5Form/ListBox.py @@ -2762,11 +2762,15 @@ class ListBoxValidator(Validator.Validator): result = {} error_result = {} - try: - listbox_uids = REQUEST['%s_uid' % field.id] - except KeyError: - raise KeyError('Field %s is not present in request object.' - % field.id) + listbox_empty = REQUEST.get('%s_empty' % field.id, False) + if listbox_empty: + listbox_uids = [] + else: + try: + listbox_uids = REQUEST['%s_uid' % field.id] + except KeyError: + raise KeyError('Field %s is not present in request object.' + % field.id) select = field.get_value('select') if select: selected_uid_set = set(REQUEST.get('uids', ()))