diff --git a/addons/website_sale/controllers/main.py b/addons/website_sale/controllers/main.py index 3d6e4e76e87..b2257321534 100644 --- a/addons/website_sale/controllers/main.py +++ b/addons/website_sale/controllers/main.py @@ -540,9 +540,9 @@ class WebsiteSale(http.Controller): image_res_id = int(image_res_id) if image_res_model == 'product.product': - request.env['product.product'].browse(image_res_id).image_1920 = False + request.env['product.product'].browse(image_res_id).write({'image_1920': False}) elif image_res_model == 'product.template': - request.env['product.template'].browse(image_res_id).image_1920 = False + request.env['product.template'].browse(image_res_id).write({'image_1920': False}) else: request.env['product.image'].browse(image_res_id).unlink() diff --git a/addons/website_sale/static/src/js/website_sale.editor.js b/addons/website_sale/static/src/js/website_sale.editor.js index 481e48543ef..3646358824e 100644 --- a/addons/website_sale/static/src/js/website_sale.editor.js +++ b/addons/website_sale/static/src/js/website_sale.editor.js @@ -959,7 +959,7 @@ options.registry.ReplaceMedia.include({ */ async willStart() { const parent = this.$target.parent(); - this.isProductPageImage = this.$target.closest('#product_detail').length > 0; + this.isProductPageImage = this.$target.closest('.o_wsale_product_images').length > 0; // Product Page images may be the product's image or a record of `product.image` this.recordModel = parent.data('oe-model'); this.recordId = parent.data('oe-id');