[16.0][FIX] shopfloor: add unique parameter to product image URL - #1238
Open
lmignon wants to merge 1 commit into
Open
[16.0][FIX] shopfloor: add unique parameter to product image URL#1238lmignon wants to merge 1 commit into
lmignon wants to merge 1 commit into
Conversation
Contributor
Author
|
ping @jbaudoux |
lmignon
force-pushed
the
16.0-shopfloor-product-image-url-unique
branch
from
August 5, 2026 13:39
51a6197 to
2d04511
Compare
simahawk
reviewed
Aug 7, 2026
| return None | ||
| return f"/web/image/product.product/{record.id}/{field_name}" | ||
| sha = hashlib.sha512( | ||
| str(getattr(record, "__last_update")).encode("utf-8") # noqa: B009 |
Author
There was a problem hiding this comment.
This is the kind of mistake that can happen when taking inspiration from Odoo's code without enough critical distance. https://github.com/odoo/odoo/blob/16.0/addons/web/models/ir_qweb_fields.py#L39
It's now changed and the code should be compatible with Odoo up to 19.0. (where '__last_update' no more exists)
lmignon
force-pushed
the
16.0-shopfloor-product-image-url-unique
branch
2 times, most recently
from
August 7, 2026 07:32
89266a7 to
c7f49df
Compare
The change adds a unique parameter to the product image URL, which is generated using a SHA-512 hash of the product's last update timestamp. This ensures that when a product image is updated, the URL will change, preventing caching issues and ensuring that users always see the most recent image.
lmignon
force-pushed
the
16.0-shopfloor-product-image-url-unique
branch
from
August 7, 2026 07:36
c7f49df to
5767fd2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The change adds a unique parameter to the product image URL, which is generated using a SHA-512 hash of the product's last update timestamp. This ensures that when a product image is updated, the URL will change, preventing caching issues and ensuring that users always see the most recent image.