Skip to content

Commit

Permalink
[ADD] added message when there is no source folder to search in to pr…
Browse files Browse the repository at this point in the history
…event a stacktrace
  • Loading branch information
benwillig committed Dec 19, 2023
1 parent 9d083ee commit b248e49
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
7 changes: 7 additions & 0 deletions cmis_web/i18n/cmis_web.pot
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,13 @@ msgstr ""
msgid "Note : the search query is case sensitive."
msgstr ""

#. module: cmis_web
#. openerp-web
#: code:addons/cmis_web/static/src/xml/form_widgets.xml:0
#, python-format
msgid "Note : the search tool can't be used because current record has no CMIS folder."
msgstr ""

#. module: cmis_web
#. openerp-web
#: code:addons/cmis_web/static/src/js/form_widgets.js:0
Expand Down
7 changes: 7 additions & 0 deletions cmis_web/i18n/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,13 @@ msgstr "Aucune donnée disponible"
msgid "Note : the search query is case sensitive."
msgstr "Remarque : la recherche est sensible aux minuscules et majuscules"

#. module: cmis_web
#. openerp-web
#: code:addons/cmis_web/static/src/xml/form_widgets.xml:0
#, python-format
msgid "Note : the search tool can't be used because current record has no CMIS folder."
msgstr "Remarque : la recherche n'est pas utilisable car l'enregistrement courant n'a pas de dossier CMIS."

#. module: cmis_web
#. openerp-web
#: code:addons/cmis_web/static/src/js/form_widgets.js:0
Expand Down
5 changes: 4 additions & 1 deletion cmis_web/static/src/js/form_widgets.js
Original file line number Diff line number Diff line change
Expand Up @@ -422,9 +422,12 @@ odoo.define('cmis_web.form_widgets', function (require) {

on_click_search: function (e) {
let self = this;
if (!self.search_enabled) {
return false;
}
let $input = self.$search_input;
let search_value = $input.val();
if (search_value.length === 1) {
if (search_value !== undefined && search_value.length === 1) {
alert(_t(
"The search criteria should at least contains 2 characters. " +
"Or empty if you want to see all documents."
Expand Down
7 changes: 7 additions & 0 deletions cmis_web/static/src/xml/form_widgets.xml
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,13 @@

</div>
</div>
<div class="form-group" t-if="!widget.search_enabled">
<div class="col-sm-12">
<p class="text-muted">
Note : the search tool can't be used because current record has no CMIS folder.
</p>
</div>
</div>
</form>
</t>

Expand Down

0 comments on commit b248e49

Please sign in to comment.