mirror of https://github.com/OCA/web.git
[10.0][MIG]migrate web_widget_image_download
parent
120a9a576b
commit
841c78960a
|
@ -20,7 +20,7 @@ To use this module, you need to:
|
||||||
|
|
||||||
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
|
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
|
||||||
:alt: Try me on Runbot
|
:alt: Try me on Runbot
|
||||||
:target: https://runbot.odoo-community.org/runbot/162/8.0
|
:target: https://runbot.odoo-community.org/runbot/162/10.0
|
||||||
|
|
||||||
Known Issues / Roadmap
|
Known Issues / Roadmap
|
||||||
======================
|
======================
|
||||||
|
@ -43,6 +43,7 @@ Contributors
|
||||||
|
|
||||||
* Flavio Corpa <flavio.corpa@tecnativa.com>
|
* Flavio Corpa <flavio.corpa@tecnativa.com>
|
||||||
* Jairo Llopis <jairo.llopis@tecnativa.com>
|
* Jairo Llopis <jairo.llopis@tecnativa.com>
|
||||||
|
* Kaushal Prajapati <kbprajapati@live.com>
|
||||||
|
|
||||||
Maintainer
|
Maintainer
|
||||||
----------
|
----------
|
||||||
|
|
|
@ -4,13 +4,13 @@
|
||||||
{
|
{
|
||||||
"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": "9.0.1.0.0",
|
"version": "10.0.1.0.0",
|
||||||
"category": "web",
|
"category": "web",
|
||||||
"website": "https://www.tecnativa.com",
|
"website": "https://www.tecnativa.com",
|
||||||
"author": "Tecnativa, Odoo Community Association (OCA)",
|
"author": "Tecnativa, Odoo Community Association (OCA), Kaushal Prajapati",
|
||||||
"license": "LGPL-3",
|
"license": "LGPL-3",
|
||||||
"application": False,
|
"application": False,
|
||||||
"installable": True,
|
'installable': True,
|
||||||
"data": [
|
"data": [
|
||||||
"views/assets.xml",
|
"views/assets.xml",
|
||||||
],
|
],
|
|
@ -2,7 +2,7 @@
|
||||||
* Copyright 2016 Jairo Llopis <jairo.llopis@tecnativa.com>
|
* Copyright 2016 Jairo Llopis <jairo.llopis@tecnativa.com>
|
||||||
* License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */
|
* License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */
|
||||||
|
|
||||||
.openerp .oe_form .oe_form_field_image .oe_form_field_image_controls
|
.o_form_field_image .o_form_image_controls
|
||||||
.oe_form_binary_file_download {
|
.o_form_binary_file_download {
|
||||||
color: inherit;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,12 +5,11 @@ odoo.define('web_widget_image_download.widget', function (require) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var core = require('web.core');
|
var core = require('web.core');
|
||||||
var $ = require('$');
|
|
||||||
|
|
||||||
core.form_widget_registry.get("image").include({
|
core.form_widget_registry.get("image").include({
|
||||||
render_value: function () {
|
render_value: function () {
|
||||||
this._super();
|
this._super();
|
||||||
var $widget = this.$el.find('.oe_form_binary_file_download');
|
var $widget = this.$el.find('.o_form_binary_file_download');
|
||||||
this.imgSrc = this.$el.find('img[name="' + this.name + '"]')
|
this.imgSrc = this.$el.find('img[name="' + this.name + '"]')
|
||||||
.attr('src');
|
.attr('src');
|
||||||
|
|
||||||
|
@ -28,7 +27,7 @@ odoo.define('web_widget_image_download.widget', function (require) {
|
||||||
|
|
||||||
// Replace with jQuery to keep inheritance intact
|
// Replace with jQuery to keep inheritance intact
|
||||||
if (this.has_custom_image()) {
|
if (this.has_custom_image()) {
|
||||||
this.$el.find('.oe_form_binary_file_clear')
|
this.$el.find('.o_clear_file_button')
|
||||||
.removeClass('col-md-offset-5');
|
.removeClass('col-md-offset-5');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,9 +4,10 @@
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<t t-extend="FieldBinaryImage">
|
<t t-extend="FieldBinaryImage">
|
||||||
<t t-jquery=".oe_form_binary_file_edit" t-operation="after">
|
<t t-jquery=".o_select_file_button" t-operation="after">
|
||||||
<t t-if="widget.has_custom_image()">
|
<t t-if="widget.has_custom_image()">
|
||||||
<a class="fa fa-download fa-1g col-md-4 oe_form_binary_file_download" title="Download"></a>
|
<a class="fa fa-download o_form_binary_file_download"
|
||||||
|
title="Download"/>
|
||||||
</t>
|
</t>
|
||||||
</t>
|
</t>
|
||||||
</t>
|
</t>
|
||||||
|
|
Loading…
Reference in New Issue