From fceb20d33ac6e6e48e4f361c1d66e14df075be62 Mon Sep 17 00:00:00 2001 From: ernesto Date: Mon, 28 May 2018 00:01:05 -0400 Subject: [PATCH] [MIG] web_widget_image_download: Migration to 11.0 --- web_widget_image_download/README.rst | 2 +- web_widget_image_download/__manifest__.py | 3 +-- .../src/css/web_widget_image_download.css | 2 +- .../static/src/js/web_widget_image_download.js | 18 ++++-------------- .../src/xml/web_widget_image_download.xml | 2 +- 5 files changed, 8 insertions(+), 19 deletions(-) diff --git a/web_widget_image_download/README.rst b/web_widget_image_download/README.rst index 70acecc8..31d8940d 100644 --- a/web_widget_image_download/README.rst +++ b/web_widget_image_download/README.rst @@ -20,7 +20,7 @@ To use this module, you need to: .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/162/10.0 + :target: https://runbot.odoo-community.org/runbot/162/11.0 Known Issues / Roadmap ====================== diff --git a/web_widget_image_download/__manifest__.py b/web_widget_image_download/__manifest__.py index 3a708e65..ad9e3d5e 100644 --- a/web_widget_image_download/__manifest__.py +++ b/web_widget_image_download/__manifest__.py @@ -1,10 +1,9 @@ -# -*- coding: utf-8 -*- # Copyright 2016 Flavio Corpa # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). { "name": "Web Widget - Image Download", "summary": "Allows to download any image from its widget", - "version": "10.0.1.0.0", + "version": "11.0.1.0.0", "category": "web", "website": "https://www.tecnativa.com", "author": "Tecnativa, Odoo Community Association (OCA), Kaushal Prajapati", diff --git a/web_widget_image_download/static/src/css/web_widget_image_download.css b/web_widget_image_download/static/src/css/web_widget_image_download.css index 34b9a591..05b9f226 100644 --- a/web_widget_image_download/static/src/css/web_widget_image_download.css +++ b/web_widget_image_download/static/src/css/web_widget_image_download.css @@ -2,7 +2,7 @@ * Copyright 2016 Jairo Llopis * License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */ -.o_form_field_image .o_form_image_controls +.o_field_image .o_form_image_controls .o_form_binary_file_download { color: #fff; } diff --git a/web_widget_image_download/static/src/js/web_widget_image_download.js b/web_widget_image_download/static/src/js/web_widget_image_download.js index 688ea1c7..075a33cb 100644 --- a/web_widget_image_download/static/src/js/web_widget_image_download.js +++ b/web_widget_image_download/static/src/js/web_widget_image_download.js @@ -4,10 +4,10 @@ odoo.define('web_widget_image_download.widget', function (require) { 'use strict'; - var core = require('web.core'); + var FieldBinaryImage = require('web.basic_fields').FieldBinaryImage; - core.form_widget_registry.get("image").include({ - render_value: function () { + FieldBinaryImage.include({ + _render: function () { this._super(); var $widget = this.$el.find('.o_form_binary_file_download'); this.imgSrc = this.$el.find('img[name="' + this.name + '"]') @@ -25,17 +25,7 @@ odoo.define('web_widget_image_download.widget', function (require) { } }); - // Replace with jQuery to keep inheritance intact - if (this.has_custom_image()) { - this.$el.find('.o_clear_file_button') - .removeClass('col-md-offset-5'); - } - $widget.attr('href', this.imgSrc); - }, - - has_custom_image: function () { - return this.imgSrc != this.placeholder; - }, + } }); }); diff --git a/web_widget_image_download/static/src/xml/web_widget_image_download.xml b/web_widget_image_download/static/src/xml/web_widget_image_download.xml index ef25f9e0..40cd28d0 100644 --- a/web_widget_image_download/static/src/xml/web_widget_image_download.xml +++ b/web_widget_image_download/static/src/xml/web_widget_image_download.xml @@ -5,7 +5,7 @@