diff options
| author | Vincent Schippefilt <vsc@odoo.com> | 2019-07-26 13:43:17 +0000 |
|---|---|---|
| committer | Vincent Schippefilt <vsc@odoo.com> | 2019-07-29 09:24:18 +0000 |
| commit | ba1f4dc381dc412cfbed84831bedd1af704d2ff2 (patch) | |
| tree | a30d0be47aa50b4499763209d8593e124127b481 /addons/web/static | |
| parent | 56f74a63be9296ef5d0c8d1228e2b44d97bbeeaa (diff) | |
[FIX] web: fix error when image field can't load image
when image field cannot load an image, it will default to the placeholder image.
If this placeholder image also cannot be loaded it was creating an infinite loop errors
After this commit, we only show one error if the original image cannot be downloaded
and if the placeholder cannot be downloaded, we don't show anything else.
closes odoo/odoo#35226
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
Diffstat (limited to 'addons/web/static')
| -rw-r--r-- | addons/web/static/src/js/fields/basic_fields.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js index bf1b1139998..b3bf09ab88d 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -1586,8 +1586,8 @@ var FieldBinaryImage = AbstractFieldBinary.extend({ } this.$('> img').remove(); this.$el.prepend($img); + $img.one('error', function () { - self._clearFile(); $img.attr('src', self.placeholder); self.do_warn(_t("Image"), _t("Could not display the selected image.")); }); |
