I found this answer and it helps to remove the download button from field's widget, but how can I do this with the main widget? I mean, the one that appears when you click on records' attachments. Remove download button from odoo's pdf_viewer widget
Also I'm reading this about "Modifying a main widget from the interface" but I don't find the way to do this with the main widget https://www.odoo.com/documentation/15.0/developer/reference/frontend/javascript_cheatsheet.html
I tried with this code but it wont' help, only on the fields widget. At least that's what I see.
var basic_fields = require('web.basic_fields');
basic_fields.FieldPdfViewer.include({
_disableButtons: function (iframe) {
$(iframe).contents().find('button#download').hide();
// $(iframe).contents().find('button#secondaryDownload').hide();
this._super(iframe);
},
});`