forked from Techsystech/web
[MIG]web_widget_image_download: Migration to 17.0
parent
679fe16aa1
commit
6889933054
|
@ -3,7 +3,7 @@
|
||||||
{
|
{
|
||||||
"name": "Web Widget - Image Download",
|
"name": "Web Widget - Image Download",
|
||||||
"summary": "Allows to download any image from its widget",
|
"summary": "Allows to download any image from its widget",
|
||||||
"version": "16.0.1.0.0",
|
"version": "17.0.1.0.0",
|
||||||
"category": "web",
|
"category": "web",
|
||||||
"website": "https://github.com/OCA/web",
|
"website": "https://github.com/OCA/web",
|
||||||
"author": "Tecnativa, Odoo Community Association (OCA), Kaushal Prajapati",
|
"author": "Tecnativa, Odoo Community Association (OCA), Kaushal Prajapati",
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
import {patch} from "@web/core/utils/patch";
|
import {patch} from "@web/core/utils/patch";
|
||||||
import {ImageField} from "@web/views/fields/image/image_field";
|
import {ImageField} from "@web/views/fields/image/image_field";
|
||||||
|
|
||||||
patch(ImageField.prototype, "web_widget_image_download", {
|
patch(ImageField.prototype, {
|
||||||
download() {
|
download() {
|
||||||
const downloadLink = document.createElement("a");
|
const downloadLink = document.createElement("a");
|
||||||
downloadLink.setAttribute("href", this.getUrl(this.props.name));
|
downloadLink.setAttribute("href", this.getUrl(this.props.name));
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
t-name="web_widget_image_download.ImageField"
|
t-name="web_widget_image_download.ImageField"
|
||||||
t-inherit="web.ImageField"
|
t-inherit="web.ImageField"
|
||||||
t-inherit-mode="extension"
|
t-inherit-mode="extension"
|
||||||
owl="1"
|
|
||||||
>
|
>
|
||||||
<xpath expr="//FileUploader/../.." position="after">
|
<xpath expr="//FileUploader/../.." position="after">
|
||||||
<div
|
<div
|
||||||
|
@ -15,7 +14,7 @@
|
||||||
t-att-style="sizeStyle"
|
t-att-style="sizeStyle"
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
t-if="props.value and state.isValid"
|
t-if="props.record.data[props.name] and state.isValid"
|
||||||
class="o_form_binary_file_download btn btn-light border-0 rounded-circle m-1 p-1"
|
class="o_form_binary_file_download btn btn-light border-0 rounded-circle m-1 p-1"
|
||||||
data-tooltip="Download"
|
data-tooltip="Download"
|
||||||
aria-label="Download"
|
aria-label="Download"
|
||||||
|
|
Loading…
Reference in New Issue