I am hiding the "New" button in sales, and I managed to do it. But now, I am trying to make that same button visible only for a specific group of people, but I haven't been able to achieve it. So far, I have only been able to make it invisible for everyone or create a button next to it.
This is the code I am using and the relevant routes.
gec_accounting
static
src
xml
<?xml version="1.0" encoding="UTF-8" ?>
<templates xml:space="preserve">
<t t-inherit="web.ListView.Buttons" t-inherit-mode="extension">
<xpath expr="//button[contains(@class, 'o_list_button_add')]" position="attributes">
<attribute name="style">display: none;</attribute>
</xpath>
</t>
</templates>
manifest
'assets': {
'web.assets_backend': [
'gec_accounting/static/src/xml/buttons_hide.xml',
],
},