[FIX]attachment_preview: get preview for files in db only

This commit is contained in:
PicchiSeba 2024-05-13 16:10:16 +02:00
parent 3ba1e001d0
commit 06a0843cb5
2 changed files with 4 additions and 1 deletions

View File

@ -1,2 +1,3 @@
* Holger Brunn <mail@hunki-enterprises.com>
* Dennis Sluijk <d.sluijk@onestein.nl>
* Sebastiano Picchi <sebastiano.picchi@pytech.it>

View File

@ -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) {