You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
872 B
26 lines
872 B
odoo.define('website_upload_files.attachment', function (require) {
|
|
'use strict';
|
|
|
|
var publicWidget = require('web.public.widget');
|
|
var ajax = require('web.ajax');
|
|
publicWidget.registry.add_attachment = publicWidget.Widget.extend({
|
|
selector: '.div-class-button',
|
|
events: {
|
|
'click #button_add_attachment_payment': 'AttachmentPaymentOnClick',
|
|
},
|
|
/**
|
|
For delete the attachments
|
|
**/
|
|
AttachmentPaymentOnClick: function (ev) {
|
|
var attachment_id = ev.target.closest('div')
|
|
ajax.jsonRpc("/shop/attachments", 'call', {
|
|
"attachment_id":attachment_id.id
|
|
})
|
|
.then(function (data) {
|
|
return
|
|
});
|
|
attachment_id.remove();
|
|
},
|
|
});
|
|
return publicWidget.registry.add_attachment
|
|
});
|
|
|