summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/search.js5
-rw-r--r--addons/web/static/src/xml/base.xml4
2 files changed, 6 insertions, 3 deletions
diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js
index 570c17649c1..78f53506abc 100644
--- a/addons/web/static/src/js/search.js
+++ b/addons/web/static/src/js/search.js
@@ -1733,7 +1733,10 @@ instance.web.search.CustomFilters = instance.web.search.Input.extend({
var $name = this.$('input:first');
var private_filter = !this.$('#oe_searchview_custom_public').prop('checked');
var set_as_default = this.$('#oe_searchview_custom_default').prop('checked');
-
+ if (_.isEmpty($name.val())){
+ this.do_warn(_t("Error"), _t("Filter name is required."));
+ return false;
+ }
var search = this.view.build_search_data();
instance.web.pyeval.eval_domains_and_contexts({
domains: search.domains,
diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml
index c5bc624c2b1..2b8d6fe5efa 100644
--- a/addons/web/static/src/xml/base.xml
+++ b/addons/web/static/src/xml/base.xml
@@ -1620,8 +1620,8 @@
<ul class="oe_searchview_custom_list"/>
<div class="oe_searchview_custom">
<h4>Save current filter</h4>
- <form>
- <p><input id="oe_searchview_custom_input" placeholder="Filter name"/></p>
+ <form class="oe_form">
+ <p class="oe_form_required"><input id="oe_searchview_custom_input" placeholder="Filter name"/></p>
<p>
<input id="oe_searchview_custom_public" type="checkbox"/>
<label for="oe_searchview_custom_public">Share with all users</label>