diff --git a/document_url/README.rst b/document_url/README.rst new file mode 100644 index 00000000..fad54cc0 --- /dev/null +++ b/document_url/README.rst @@ -0,0 +1,63 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +============== +URL attachment +============== + +Module that allows to attach an URL as a document. + +Installation +============ + +To install this module, you need to click on install + +Usage +===== + +To use this module, you need to: + + * go to menu more and click on add an url. + * Insert name and url into the wizard. + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/118/9.0 + +For further information, please visit: + + * https://www.odoo.com/forum/help-1 + +Known issues / Roadmap +====================== + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed feedback +`here `_. + +Credits +======= + +Contributors +------------ + +* Jonathan Nemry +* Pedro M. Baeza -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# © 2016 ACSONE SA/NV () from . import wizard diff --git a/document_url/__openerp__.py b/document_url/__openerp__.py index 40d89b58..eee30b5f 100644 --- a/document_url/__openerp__.py +++ b/document_url/__openerp__.py @@ -1,28 +1,10 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (c) 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com) +# -*- coding: utf-8 -*- +# © 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com) # Pedro M. Baeza -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - +# © 2016 ACSONE SA/NV () { 'name': 'URL attachment', - 'version': '8.0.1.0.0', + 'version': '9.0.1.0.0', 'category': 'Tools', 'description': """ Module that allows to attach an URL as a document. @@ -40,5 +22,5 @@ Module that allows to attach an URL as a document. 'qweb': [ 'static/src/xml/url.xml', ], - 'installable': False, + 'installable': True, } diff --git a/document_url/i18n/fr.po b/document_url/i18n/fr.po new file mode 100644 index 00000000..4a3f0888 --- /dev/null +++ b/document_url/i18n/fr.po @@ -0,0 +1,95 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * document_url +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-03-15 09:24+0000\n" +"PO-Revision-Date: 2016-03-15 09:24+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: document_url +#: model:ir.ui.view,arch_db:document_url.view_ir_attachment_add_url_form +msgid "Add" +msgstr "Ajouter" + +#. module: document_url +#: model:ir.actions.act_window,name:document_url.action_ir_attachment_add_url +#: model:ir.ui.view,arch_db:document_url.view_ir_attachment_add_url_form +msgid "Add URL" +msgstr "Ajouter URL" + +#. module: document_url +#. openerp-web +#: code:addons/document_url/static/src/xml/url.xml:4 +#, python-format +msgid "Add URL..." +msgstr "Ajouter URL..." + +#. module: document_url +#: model:ir.ui.view,arch_db:document_url.view_ir_attachment_add_url_form +msgid "Cancel" +msgstr "Annuler" + +#. module: document_url +#: model:ir.model.fields,field_description:document_url.field_ir_attachment_add_url_create_uid +msgid "Created by" +msgstr "Créé par" + +#. module: document_url +#: model:ir.model.fields,field_description:document_url.field_ir_attachment_add_url_create_date +msgid "Created on" +msgstr "Créé le" + +#. module: document_url +#: model:ir.model.fields,field_description:document_url.field_ir_attachment_add_url_display_name +msgid "Display Name" +msgstr "Nom affiché" + +#. module: document_url +#: model:ir.model.fields,field_description:document_url.field_ir_attachment_add_url_id +msgid "ID" +msgstr "ID" + +#. module: document_url +#: model:ir.model.fields,field_description:document_url.field_ir_attachment_add_url___last_update +msgid "Last Modified on" +msgstr "Dernière modification le" + +#. module: document_url +#: model:ir.model.fields,field_description:document_url.field_ir_attachment_add_url_write_uid +msgid "Last Updated by" +msgstr "Mis à jour par" + +#. module: document_url +#: model:ir.model.fields,field_description:document_url.field_ir_attachment_add_url_write_date +msgid "Last Updated on" +msgstr "Mis à jour le" + +#. module: document_url +#: model:ir.model.fields,field_description:document_url.field_ir_attachment_add_url_name +msgid "Name" +msgstr "Nom" + +#. module: document_url +#: model:ir.model.fields,field_description:document_url.field_ir_attachment_add_url_url +msgid "URL" +msgstr "URL" + +#. module: document_url +#: model:ir.model,name:document_url.model_ir_attachment_add_url +msgid "ir.attachment.add_url" +msgstr "ir.attachment.add_url" + +#. module: document_url +#: model:ir.ui.view,arch_db:document_url.view_ir_attachment_add_url_form +msgid "or" +msgstr "ou" + diff --git a/document_url/static/src/css/url.css b/document_url/static/src/css/url.css new file mode 100644 index 00000000..a2484470 --- /dev/null +++ b/document_url/static/src/css/url.css @@ -0,0 +1,3 @@ +.oe_url_attachment{ + padding: 3px 20px; +} diff --git a/document_url/static/src/js/url.js b/document_url/static/src/js/url.js index 1285fd6f..0eaefa47 100644 --- a/document_url/static/src/js/url.js +++ b/document_url/static/src/js/url.js @@ -1,12 +1,23 @@ -openerp.document_url = function(instance, m) { - var _t = instance.web._t, - QWeb = instance.web.qweb; +/* © 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com) + * Pedro M. Baeza + * © 2016 ACSONE SA/NV () + * License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + */ +odoo.define('document_url', function(require) { - instance.web.Sidebar.include({ + var core = require('web.core'); + var Sidebar = require('web.Sidebar'); + var ActionManager = require('web.ActionManager'); + + var _t = core._t, + QWeb = core.qweb; + + Sidebar.include({ redraw: function() { var self = this; this._super.apply(this, arguments); - self.$el.find('.oe_sidebar_add_attachment').after(QWeb.render('AddUrlDocumentItem', {widget: self})) + self.$el.find("a[href]").attr('target', '_blank'); + self.$el.find('.oe_sidebar_add_attachment, .o_sidebar_add_attachment').after(QWeb.render('AddUrlDocumentItem', {widget: self})) self.$el.find('.oe_sidebar_add_url').on('click', function (e) { self.on_url_doc(); }); @@ -31,15 +42,15 @@ openerp.document_url = function(instance, m) { }, }); - instance.web.ActionManager = instance.web.ActionManager.extend({ + ActionManager = ActionManager.include({ ir_actions_act_close_wizard_and_reload_view: function (action, options) { if (!this.dialog) { options.on_close(); } this.dialog_stop(); - this.inner_widget.views[this.inner_widget.active_view].controller.reload(); + this.inner_widget.views[this.inner_widget.active_view.type].controller.reload(); return $.when(); }, }); -}; +}); diff --git a/document_url/static/src/xml/url.xml b/document_url/static/src/xml/url.xml index 6af648f2..147ef321 100644 --- a/document_url/static/src/xml/url.xml +++ b/document_url/static/src/xml/url.xml @@ -1,6 +1,6 @@ -
  • Add URL...
  • +
  • Add URL...
  • diff --git a/document_url/view/document_url_view.xml b/document_url/view/document_url_view.xml index e8bd2c10..27363dee 100644 --- a/document_url/view/document_url_view.xml +++ b/document_url/view/document_url_view.xml @@ -4,6 +4,7 @@ diff --git a/document_url/wizard/__init__.py b/document_url/wizard/__init__.py index 8853063f..fb2ce90d 100644 --- a/document_url/wizard/__init__.py +++ b/document_url/wizard/__init__.py @@ -1,22 +1,5 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (c) 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com) +# -*- coding: utf-8 -*- +# © 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com) # Pedro M. Baeza -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# © 2016 ACSONE SA/NV () from . import document_url diff --git a/document_url/wizard/document_url.py b/document_url/wizard/document_url.py index c68f80b1..8b7b21eb 100644 --- a/document_url/wizard/document_url.py +++ b/document_url/wizard/document_url.py @@ -1,23 +1,7 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Copyright (c) 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com) +# © 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com) # Pedro M. Baeza -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# © 2016 ACSONE SA/NV () from openerp.osv import fields, orm try: # Python 3