Skip to content

Commit ec59555

Browse files
committed
[FIX] web_editor: remove the possibility to edit readonly image field
Steps to reproduce the bug: - Add multiple images on a product page - Go to the shop and edit an image of this product by double clicking on a small image on the carousel thumbnail - Save -> Nothing happens and the image is not updated The goal of this commit is to ensure that a field of type image is not `readonly` before adding the `contenteditable` attribute to its image. task-3122670 closes odoo#114587 X-original-commit: 36fb765 Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
1 parent f464282 commit ec59555

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

addons/web_editor/static/src/js/wysiwyg/wysiwyg.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ const Wysiwyg = Widget.extend({
286286
}
287287
if ($field.data('oe-type') === "image") {
288288
$field.attr('contenteditable', false);
289-
$field.find('img').attr('contenteditable', true);
289+
$field.find('img').attr('contenteditable', $field.data('oe-readonly') !== 1);
290290
}
291291
if ($field.is('[data-oe-many2one-id]')) {
292292
$field.attr('contenteditable', false);

0 commit comments

Comments
 (0)