mirror of
https://github.com/OCA/knowledge.git
synced 2025-07-14 01:41:26 -06:00
[MIG] document_url: Migration to 14.0
TT30263
This commit is contained in:
parent
4ec002bcb9
commit
b029c7ac0a
@ -14,13 +14,13 @@ URL attachment
|
||||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
||||
:alt: License: AGPL-3
|
||||
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fknowledge-lightgray.png?logo=github
|
||||
:target: https://github.com/OCA/knowledge/tree/13.0/document_url
|
||||
:target: https://github.com/OCA/knowledge/tree/14.0/document_url
|
||||
:alt: OCA/knowledge
|
||||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
|
||||
:target: https://translation.odoo-community.org/projects/knowledge-13-0/knowledge-13-0-document_url
|
||||
:target: https://translation.odoo-community.org/projects/knowledge-14-0/knowledge-14-0-document_url
|
||||
:alt: Translate me on Weblate
|
||||
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
|
||||
:target: https://runbot.odoo-community.org/runbot/118/13.0
|
||||
:target: https://runbot.odoo-community.org/runbot/118/14.0
|
||||
:alt: Try me on Runbot
|
||||
|
||||
|badge1| |badge2| |badge3| |badge4| |badge5|
|
||||
@ -50,7 +50,7 @@ Bug Tracker
|
||||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/knowledge/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 <https://github.com/OCA/knowledge/issues/new?body=module:%20document_url%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
||||
`feedback <https://github.com/OCA/knowledge/issues/new?body=module:%20document_url%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
||||
|
||||
Do not contact contributors directly about support or help with technical issues.
|
||||
|
||||
@ -86,6 +86,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
|
||||
mission is to support the collaborative development of Odoo features and
|
||||
promote its widespread use.
|
||||
|
||||
This module is part of the `OCA/knowledge <https://github.com/OCA/knowledge/tree/13.0/document_url>`_ project on GitHub.
|
||||
This module is part of the `OCA/knowledge <https://github.com/OCA/knowledge/tree/14.0/document_url>`_ project on GitHub.
|
||||
|
||||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
||||
|
@ -3,7 +3,7 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
|
||||
<meta name="generator" content="Docutils: http://docutils.sourceforge.net/" />
|
||||
<title>URL attachment</title>
|
||||
<style type="text/css">
|
||||
|
||||
@ -367,7 +367,7 @@ ul.auto-toc {
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/knowledge/tree/13.0/document_url"><img alt="OCA/knowledge" src="https://img.shields.io/badge/github-OCA%2Fknowledge-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/knowledge-13-0/knowledge-13-0-document_url"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/118/13.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
|
||||
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/knowledge/tree/14.0/document_url"><img alt="OCA/knowledge" src="https://img.shields.io/badge/github-OCA%2Fknowledge-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/knowledge-14-0/knowledge-14-0-document_url"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/118/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
|
||||
<p>Module that allows to attach an URL as a document.</p>
|
||||
<p><strong>Table of contents</strong></p>
|
||||
<div class="contents local topic" id="contents">
|
||||
@ -399,7 +399,7 @@ the object.</li>
|
||||
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/knowledge/issues">GitHub Issues</a>.
|
||||
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
|
||||
<a class="reference external" href="https://github.com/OCA/knowledge/issues/new?body=module:%20document_url%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
||||
<a class="reference external" href="https://github.com/OCA/knowledge/issues/new?body=module:%20document_url%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
||||
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
||||
</div>
|
||||
<div class="section" id="credits">
|
||||
@ -430,7 +430,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
|
||||
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
|
||||
mission is to support the collaborative development of Odoo features and
|
||||
promote its widespread use.</p>
|
||||
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/knowledge/tree/13.0/document_url">OCA/knowledge</a> project on GitHub.</p>
|
||||
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/knowledge/tree/14.0/document_url">OCA/knowledge</a> project on GitHub.</p>
|
||||
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -3,30 +3,31 @@
|
||||
* Copyright 2016 ACSONE SA/NV (<http://acsone.eu>)
|
||||
* Copyright 2019 Tecnativa - Ernesto Tejeda
|
||||
* Copyright 2020 Tecnativa - Manuel Calero
|
||||
* Copyright 2021 Tecnativa - Víctor Martínez
|
||||
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
*/
|
||||
odoo.define("document_url", function (require) {
|
||||
"use strict";
|
||||
|
||||
var AttachmentBox = require("mail.AttachmentBox");
|
||||
const AttachmentBox = require("mail/static/src/components/attachment_box/attachment_box.js");
|
||||
const {patch} = require("web.utils");
|
||||
|
||||
AttachmentBox.include({
|
||||
events: _.extend(AttachmentBox.prototype.events, {
|
||||
"click button.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", {
|
||||
patch(AttachmentBox, "document_url", {
|
||||
_onAddUrl() {
|
||||
this.env.bus.trigger("do-action", {
|
||||
action: "document_url.action_ir_attachment_add_url",
|
||||
options: {
|
||||
additional_context: {
|
||||
active_id: this.currentResID,
|
||||
active_ids: [this.currentResID],
|
||||
active_model: this.currentResModel,
|
||||
active_id: this.thread.id,
|
||||
active_ids: [this.thread.id],
|
||||
active_model: this.thread.model,
|
||||
},
|
||||
on_close: this._onAddedUrl.bind(this),
|
||||
},
|
||||
});
|
||||
},
|
||||
_onAddedUrl: function () {
|
||||
this.trigger_up("reload_attachment_box");
|
||||
_onAddedUrl() {
|
||||
this.trigger("reload");
|
||||
},
|
||||
});
|
||||
});
|
||||
|
@ -1,17 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!-- Copyright 2018 Tecnativa - Ernesto Tejeda
|
||||
Copyright 2021 Tecnativa - Víctor Martínez
|
||||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
||||
<templates id="template" xml:space="preserve">
|
||||
<t t-extend="mail.AttachmentBox">
|
||||
<t t-jquery="button.o_AttachmentBox_buttonAdd" t-operation="after">
|
||||
<templates xml:space="preserve">
|
||||
<t t-inherit="mail.AttachmentBox" t-inherit-mode="extension" owl="1">
|
||||
<xpath expr="//button[hasclass('o_AttachmentBox_buttonAdd')]" position="after">
|
||||
<button
|
||||
type="button"
|
||||
class="o_add_url_button btn btn-link"
|
||||
t-on-click="_onClickAdd"
|
||||
t-on-click="_onAddUrl"
|
||||
>
|
||||
<i class="fa fa-plus-square" />
|
||||
Add URL
|
||||
</button>
|
||||
</t>
|
||||
</xpath>
|
||||
</t>
|
||||
</templates>
|
||||
|
@ -5,7 +5,7 @@ from odoo.tests import common
|
||||
|
||||
class TestDocumentUrl(common.TransactionCase):
|
||||
def setUp(self):
|
||||
super(TestDocumentUrl, self).setUp()
|
||||
super().setUp()
|
||||
wizard_add_url = self.env["ir.attachment.add_url"]
|
||||
ctx = {
|
||||
"active_model": "res.users",
|
||||
|
@ -9,12 +9,12 @@
|
||||
<script type="text/javascript" src="/document_url/static/src/js/url.js" />
|
||||
</xpath>
|
||||
</template>
|
||||
<record model='ir.actions.act_window' id='action_ir_attachment_add_url'>
|
||||
<field name='name'>Add URL</field>
|
||||
<field name='res_model'>ir.attachment.add_url</field>
|
||||
<field name='type'>ir.actions.act_window</field>
|
||||
<field name='target'>new</field>
|
||||
<field name='view_mode'>form</field>
|
||||
<record model="ir.actions.act_window" id='action_ir_attachment_add_url'>
|
||||
<field name="name">Add URL</field>
|
||||
<field name="res_model">ir.attachment.add_url</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="target">new</field>
|
||||
<field name="view_mode">form</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_ir_attachment_add_url_form">
|
||||
<field name="name">ir.attachment.add_url.form</field>
|
||||
|
Loading…
Reference in New Issue
Block a user