I'm trying to display a Share Button if the user has a specific group, the button seems like it's an action that launches an ir.actions.act_window
I tried to locate it with XPath using the name but seems like due to the button nature the name changes depending on the environment (names can vary to be like 123 or 124 and so on in other environments)
the button launches a window action with the following action external ID portal.portal_share_action
I tried to use a group attribute referencing action ID in an XML file that is part of the custom project module I built, the code is the following:
<record model="ir.actions.act_window" id="portal.portal_share_action">
<field name="groups" eval="[(6,0,[ref('rw_project.group_project_rw_base_user')])]"/>
</record>
The button still show even if the user doesn't have the group assigned
Edit:
The button is located in the project form and the xml is the following:
<header>
<button name="132" string="Share" type="action" class="oe_highlight oe_read_only"/>
</header>