Skip to content

Commit

Permalink
[IMP]connection_elasticsearch: show 'Already cleared' message
Browse files Browse the repository at this point in the history
  • Loading branch information
PicchiSeba committed Sep 10, 2024
1 parent 00de767 commit adb0fe3
Show file tree
Hide file tree
Showing 3 changed files with 567 additions and 0 deletions.
10 changes: 10 additions & 0 deletions connector_elasticsearch/components/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,16 @@ def clear(self):
res = es.indices.delete(index=self._index_name, ignore=[400, 404])
# recreate the index
self._get_es_client()
if "error" in res.keys() and res["error"].get("index_uuid") == "_na_":
return {
"type": "ir.actions.client",
"tag": "display_notification",
"params": {
"title": _("Already cleared!"),
"message": _("There was nothing to clear!"),
"sticky": False,
},
}
return res["acknowledged"]

def each(self):
Expand Down
Loading

0 comments on commit adb0fe3

Please sign in to comment.