I have added smartbutton in res.partner form view header that opens the current partner helpdesk tickets (helpdesk.ticket model).

Smartbutton view (If i remove this code then button is removed and users can freely open partner form view)
<odoo>
<data>
<record id="helpdesk_ticket_smart_button" model="ir.ui.view">
<field name="name">partner.helpdesk.ticket.smart.buttons</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form" />
<field name="arch" type="xml">
<div name="button_box" position="inside">
<button class="oe_stat_button" type="object" name="action_view_helpdesk_tickets" icon="fa-ticket">
<field string="Tickets" name="helpdesk_ticket_count" widget="statinfo"/>
</button>
</div>
</field>
</record>
</data>
</odoo>
Unfortunately now, after a non-helpdesk user tries to open any partner form he gets blocked due to Access Error.

What can i change so that any odoo user can open partner form view without getting blocked but only helpdesk users can see the Tickets smartbutton?
Any help would be appreciated. Let me know if you need more information.
You can set a group on your extension view:
<field name="groups_id" eval="[(4,ref('helpdesk.group_helpdesk_user'))]"/>Will look like this:
Odoo will only load the extension view for users in the groups that are set on the view.