Skip to content

Commit

Permalink
[FIX]attachment_preview: get preview for files in db only
Browse files Browse the repository at this point in the history
  • Loading branch information
PicchiSeba committed Jun 27, 2024
1 parent 3ba1e00 commit 06a0843
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions attachment_preview/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
* Holger Brunn <[email protected]>
* Dennis Sluijk <[email protected]>
* Sebastiano Picchi <[email protected]>
4 changes: 3 additions & 1 deletion attachment_preview/static/src/js/attachment_preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,9 @@ odoo.define("/attachment_preview/static/src/js/attachment_preview.js", function

attachments = _.object(
attachments.map((att) => {
return parseInt(att.localId.slice(16), 10);
const tmp_id = parseInt(att.localId.slice(16), 10);
if (tmp_id > 0) return tmp_id;
return null;
}),
attachments.map((at) => {
if (at.defaultSource) {
Expand Down

0 comments on commit 06a0843

Please sign in to comment.