[MIG] document_url: Migration to 13.0

This commit is contained in:
Manuel Calero
2020-03-11 11:01:29 +01:00
committed by FernandoRomera
parent 1b3bb42821
commit 6c43c97afb
9 changed files with 38 additions and 37 deletions

View File

@@ -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");
},
});
});