[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>
This commit is contained in:
Vincent Schippefilt
2019-07-29 09:24:18 +00:00
parent 56f74a63be
commit ba1f4dc381
@@ -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."));
});