From 150fc064fd1481616d665b6f6f4ce8a4123d3f6a Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 5 Dec 2017 13:31:08 +0100 Subject: [PATCH] [FIX] product: image changes not sticking everywhere Fixes #20046 Simply reverting e5ef1c59172b7b8ebb1912e015fd41003ffc275d looks to work *but* since I didn't note the repro case for the issue and don't remember what it was it may re-introduce previous breakage. Instead, ensure all "sizes" for the image are reset if any of the sizes is present *and* Falsy by adding a final case to the conditional. If any of the image fields is present and non-falsy one of the previous branches will be taken, so we can just check that any of the image fields is present at all (this implies it's falsy). --- odoo/tools/image.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/odoo/tools/image.py b/odoo/tools/image.py index fd425ed7791..24da52b3c81 100644 --- a/odoo/tools/image.py +++ b/odoo/tools/image.py @@ -282,6 +282,8 @@ def image_resize_images(vals, big_name='image', medium_name='image_medium', smal return_big=True, return_medium=True, return_small=True, big_name=big_name, medium_name=medium_name, small_name=small_name, avoid_resize_big=True, avoid_resize_medium=True, avoid_resize_small=True)) + elif big_name in vals or medium_name in vals or small_name in vals: + vals[big_name] = vals[medium_name] = vals[small_name] = False if __name__=="__main__":