From f0bc5e0b52710784e0aa49de15ced5e91a4a7145 Mon Sep 17 00:00:00 2001 From: Romain Derie Date: Thu, 25 Apr 2019 08:46:21 +0000 Subject: [PATCH] [FIX] web_unsplash: correctly load images after credentials Since media dialog and unsplash refactoring (1f847a1e2e, 78a30d44c) there was a bug after adding credentials. Indeed, when doing a search for the first time and no credentials are set, it shows a form to add the missing credentials. When saving those, it should automatically perform the initial search now that the credentials are set. But it was not the case anymore, it would keep reloading the credential form. User would have to close and reopen media dialog. closes odoo/odoo#32943 Signed-off-by: Quentin Smetz (qsm) --- addons/web_unsplash/static/src/js/unsplash_image_widget.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/web_unsplash/static/src/js/unsplash_image_widget.js b/addons/web_unsplash/static/src/js/unsplash_image_widget.js index 4338b7d6dd0..a0ccd00d667 100644 --- a/addons/web_unsplash/static/src/js/unsplash_image_widget.js +++ b/addons/web_unsplash/static/src/js/unsplash_image_widget.js @@ -227,7 +227,8 @@ weWidgets.ImageWidget.include({ params: params, }).then(function () { self.unsplashAPI.clientId = key; - self._renderImages(); + self._unsplash.error = false; + self.search(self._unsplash.query); }); } }