Skip to content

Commit

Permalink
Merge PR OCA#305 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by lmignon
  • Loading branch information
OCA-git-bot committed Dec 2, 2023
2 parents 0dfe2e7 + 50bb88e commit adbb461
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion fs_image/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Fs Image
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:8eb8ee4966145a3d8461a1c8a25b79ea08a357c40a16ad606ea61ac6de31e6a8
!! source digest: sha256:ec5ca93b7010a87e11c66139815adfbcd5da6df9f8508d27c7da172a5513a424
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png
Expand Down
6 changes: 6 additions & 0 deletions fs_image/readme/newsfragments/305.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Fix view crash when uploading an image

The rawCacheKey is appropriately managed by the base class and reflects the
record's last update datetime (write_date).
Since it lacks a setter, attempting to invalidate its value results in a view crash.
Nevertheless, the value will automatically be updated upon saving the record.
2 changes: 1 addition & 1 deletion fs_image/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Fs Image</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:8eb8ee4966145a3d8461a1c8a25b79ea08a357c40a16ad606ea61ac6de31e6a8
!! source digest: sha256:ec5ca93b7010a87e11c66139815adfbcd5da6df9f8508d27c7da172a5513a424
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Alpha" src="https://img.shields.io/badge/maturity-Alpha-red.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/storage/tree/16.0/fs_image"><img alt="OCA/storage" src="https://img.shields.io/badge/github-OCA%2Fstorage-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/storage-16-0/storage-16-0-fs_image"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/storage&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This addon defines a new field <strong>FSImage</strong> to use in your models. It is a
Expand Down
5 changes: 0 additions & 5 deletions fs_image/static/src/views/fields/fsimage_field.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ export class FSImageField extends ImageField {
fileTypeMagicWordMap[this.props.value.content[0]] || "png";
return `data:image/${magic};base64,${this.props.value.content}`;
}
if (!this.rawCacheKey) {
this.rawCacheKey = this.props.record.data.__last_update;
}
const model = this.props.record.resModel;
const id = this.props.record.resId;
let base_url = this.props.value.url;
Expand All @@ -72,8 +69,6 @@ export class FSImageField extends ImageField {

onFileUploaded(info) {
this.state.isValid = true;
// Invalidate the `rawCacheKey`.
this.rawCacheKey = null;
this.props.update({
filename: info.name,
content: info.data,
Expand Down

0 comments on commit adbb461

Please sign in to comment.