From 7b358225347f1e04e6652af4de24786cc9ce37e9 Mon Sep 17 00:00:00 2001 From: Manuel Calero Date: Wed, 11 Mar 2020 11:01:29 +0100 Subject: [PATCH] [MIG] document_url: Migration to 13.0 --- document_url/__init__.py | 2 +- document_url/__manifest__.py | 8 +++---- document_url/readme/CONTRIBUTORS.rst | 1 + document_url/security/ir.model.access.csv | 2 -- document_url/static/src/js/url.js | 20 ++++++++--------- document_url/static/src/xml/url.xml | 8 +++---- document_url/view/document_url_view.xml | 26 +++++++++++++---------- document_url/wizard/__init__.py | 2 +- document_url/wizard/document_url.py | 6 +++--- 9 files changed, 38 insertions(+), 37 deletions(-) delete mode 100644 document_url/security/ir.model.access.csv diff --git a/document_url/__init__.py b/document_url/__init__.py index 7e0bab22..5f3c3bc9 100644 --- a/document_url/__init__.py +++ b/document_url/__init__.py @@ -1,4 +1,4 @@ # Copyright 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com) -# Pedro M. Baeza +# Copyright 2014 Tecnativa - Pedro M. Baeza # Copyright 2016 ACSONE SA/NV () from . import wizard diff --git a/document_url/__manifest__.py b/document_url/__manifest__.py index 1a0bd562..1ea6b2ee 100644 --- a/document_url/__manifest__.py +++ b/document_url/__manifest__.py @@ -1,15 +1,13 @@ -# Copyright 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com) -# Pedro M. Baeza -# Copyright 2016 ACSONE SA/NV () +# Copyright 2014 Tecnativa - Pedro M. Baeza # Copyright 2020 Tecnativa - Manuel Calero { "name": "URL attachment", "version": "13.0.1.0.0", "category": "Tools", - "author": "Tecnativa," "Odoo Community Association (OCA)", + "author": "Tecnativa, Odoo Community Association (OCA)", "website": "https://github.com/OCA/knowledge", "license": "AGPL-3", - "data": ["view/document_url_view.xml", "security/ir.model.access.csv"], + "data": ["view/document_url_view.xml"], "qweb": ["static/src/xml/url.xml"], "installable": True, } diff --git a/document_url/readme/CONTRIBUTORS.rst b/document_url/readme/CONTRIBUTORS.rst index c3458d40..f923719f 100644 --- a/document_url/readme/CONTRIBUTORS.rst +++ b/document_url/readme/CONTRIBUTORS.rst @@ -4,3 +4,4 @@ * Pedro M. Baeza * Ernesto Tejeda * Manuel Calero + * Víctor Martínez diff --git a/document_url/security/ir.model.access.csv b/document_url/security/ir.model.access.csv deleted file mode 100644 index 6f32fcb0..00000000 --- a/document_url/security/ir.model.access.csv +++ /dev/null @@ -1,2 +0,0 @@ -id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_ir_attachment_add_url,access_ir_attachment_add_url,model_ir_attachment_add_url,,1,1,1,1 diff --git a/document_url/static/src/js/url.js b/document_url/static/src/js/url.js index 329c9a16..901d3761 100644 --- a/document_url/static/src/js/url.js +++ b/document_url/static/src/js/url.js @@ -5,28 +5,28 @@ * Copyright 2020 Tecnativa - Manuel Calero * License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). */ -odoo.define('document_url', function (require) { +odoo.define("document_url", function(require) { "use strict"; - var AttachmentBox = require('mail.AttachmentBox'); + var AttachmentBox = require("mail.AttachmentBox"); AttachmentBox.include({ events: _.extend(AttachmentBox.prototype.events, { "click span.o_add_url_button": "_onAddUrl", }), - _onAddUrl: function () { - // Opens wizard to add an URL attachment to the current record - this.do_action('document_url.action_ir_attachment_add_url', { + _onAddUrl: function() { + // Opens wizard to add an URL attachment to the current record + this.do_action("document_url.action_ir_attachment_add_url", { additional_context: { - 'active_id': this.currentResID, - 'active_ids': [this.currentResID], - 'active_model': this.currentResModel, + active_id: this.currentResID, + active_ids: [this.currentResID], + active_model: this.currentResModel, }, on_close: this._onAddedUrl.bind(this), }); }, - _onAddedUrl: function () { - this.trigger_up('reload_attachment_box'); + _onAddedUrl: function() { + this.trigger_up("reload_attachment_box"); }, }); }); diff --git a/document_url/static/src/xml/url.xml b/document_url/static/src/xml/url.xml index dbc0adfa..b09bb1c8 100644 --- a/document_url/static/src/xml/url.xml +++ b/document_url/static/src/xml/url.xml @@ -1,12 +1,12 @@ - + - - Add URL + Add URL - diff --git a/document_url/view/document_url_view.xml b/document_url/view/document_url_view.xml index 0c7dcffe..9e38a658 100644 --- a/document_url/view/document_url_view.xml +++ b/document_url/view/document_url_view.xml @@ -1,37 +1,41 @@ - + - -