[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:
@@ -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."));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user