Skip to content

Commit

Permalink
[FIX] product: image changes not sticking everywhere
Browse files Browse the repository at this point in the history
Fixes odoo#20046

Simply reverting e5ef1c5 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).
  • Loading branch information
xmo-odoo committed Dec 5, 2017
1 parent 6d7d6d9 commit 150fc06
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions odoo/tools/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__":
Expand Down

0 comments on commit 150fc06

Please sign in to comment.