Skip to content

Commit

Permalink
Merge PR #357 into 14.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Aug 6, 2024
2 parents e217143 + 3f31fa8 commit c8d8c3b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
18 changes: 5 additions & 13 deletions dms_field/static/src/js/base/dms_tree_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ odoo.define("dms.DmsTreeController", function (require) {
"count_files",
"name",
"parent_id",
"icon_url",
"__last_update",
]),
domain: this._buildDMSDomain(
Expand Down Expand Up @@ -165,6 +166,7 @@ odoo.define("dms.DmsTreeController", function (require) {
"count_files",
"name",
"parent_id",
"icon_url",
"__last_update",
]),
domain: this._buildDMSDomain(
Expand All @@ -187,6 +189,7 @@ odoo.define("dms.DmsTreeController", function (require) {
"permission_create",
"permission_write",
"permission_unlink",
"icon_url",
"name",
"mimetype",
"directory_id",
Expand Down Expand Up @@ -383,13 +386,7 @@ odoo.define("dms.DmsTreeController", function (require) {
perm_create: directory.permission_create,
perm_write: directory.permission_write,
perm_unlink: directory.permission_unlink,

thumbnail_link: session.url("/web/image", {
model: "dms.directory",
field: "thumbnail_medium",
unique: directory.__last_update.replace(/[^0-9]/g, ""),
id: directory.id,
}),
icon_url: directory.icon_url,
});
if (
storage &&
Expand Down Expand Up @@ -434,12 +431,7 @@ odoo.define("dms.DmsTreeController", function (require) {
file.permission_write && (!file.is_locked || file.is_lock_editor),
perm_unlink:
file.permission_unlink && (!file.is_locked || file.is_lock_editor),
thumbnail_link: session.url("/web/image", {
model: "dms.file",
field: "thumbnail_medium",
unique: file.__last_update.replace(/[^0-9]/g, ""),
id: file.id,
}),
icon_url: file.icon_url,
});
var dt = this._makeDataPoint({
data: data,
Expand Down
13 changes: 12 additions & 1 deletion dms_field/static/src/xml/preview.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,20 @@
<div class="o_preview_directory_icon" align="center">
<div>
<img
t-if="dms_object.model === 'dms.directory'"
class="h-100 w-100"
t-att-src="dms_object.data.thumbnail_link"
t-att-src="dms_object.data.icon_url"
/>
<a
t-if="dms_object.model === 'dms.file'"
class="o_preview_file"
t-att-data-id="dms_object.id"
>
<img
class="h-100 w-100"
t-att-src="dms_object.data.icon_url"
/>
</a>
</div>
<div>
<button
Expand Down

0 comments on commit c8d8c3b

Please sign in to comment.