I’m trying to hide the upload button, as many people may be seeing it (image attached).
And I found the files in the Odoo v18 repository where this functionality is added:
in account:
odoo/odoo/addons/account/static/src/components/account_file_uploader
odoo/odoo/addons/account/static/src/views/file_upload_list
in sales:
odoo/odoo/addons/sale/static/src/views/sale_onboarding_list
odoo/odoo/addons/sale/static/src/views/sale_onboarding_kanban
I’m trying to hide the button in the sales module for a specific group I created using JavaScript, but I’m not getting it to work.
Here’s my code:
/** u/odoo-module **/
import { patch } from “@web/core/utils/patch”;
import { SaleListRenderer } from “@sale/views/sale_onboarding_list/sale_onboarding_list_renderer”;
import { useService } from “@web/core/utils/hooks”;
patch(SaleListRenderer.prototype, {
setup() {
super.setup?.();
this.user = useService(“user”);
},
mounted() {
super.mounted?.();
if (this.user.hasGroup(“modulo.grupo_restringido”)) {
const uploadButton = this.el.querySelector(“.o_button_upload_bill, a”);
if (uploadButton) {
uploadButton.style.display = “none”;
}
}
},
});
First, I checked the console and found that o_button_upload_bill wasn’t there.
Then I tried using a query selector that did contain:querySelector('button[data-hotkey="shift+i"]')When I check the console to see if it finds the button using the second querySelector, I can’t get it to disappear for the group I set. Can someone please help me?

