diff --git a/fs_image/README.rst b/fs_image/README.rst index 525f007350..1b88840576 100644 --- a/fs_image/README.rst +++ b/fs_image/README.rst @@ -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 diff --git a/fs_image/readme/newsfragments/305.bugfix b/fs_image/readme/newsfragments/305.bugfix new file mode 100644 index 0000000000..85eff0f21a --- /dev/null +++ b/fs_image/readme/newsfragments/305.bugfix @@ -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. diff --git a/fs_image/static/description/index.html b/fs_image/static/description/index.html index 6550839892..9d2d51255d 100644 --- a/fs_image/static/description/index.html +++ b/fs_image/static/description/index.html @@ -367,7 +367,7 @@

Fs Image

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:8eb8ee4966145a3d8461a1c8a25b79ea08a357c40a16ad606ea61ac6de31e6a8 +!! source digest: sha256:ec5ca93b7010a87e11c66139815adfbcd5da6df9f8508d27c7da172a5513a424 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Alpha License: AGPL-3 OCA/storage Translate me on Weblate Try me on Runboat

This addon defines a new field FSImage to use in your models. It is a diff --git a/fs_image/static/src/views/fields/fsimage_field.esm.js b/fs_image/static/src/views/fields/fsimage_field.esm.js index adc4ffc618..fe286764f5 100644 --- a/fs_image/static/src/views/fields/fsimage_field.esm.js +++ b/fs_image/static/src/views/fields/fsimage_field.esm.js @@ -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; @@ -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,