Files
Odoo-Modules/fusion_planning/views/planning_slot_views.xml
gsinghpal b7817b752c feat(fusion_planning): hide Role field from Add Shift dialog
Role is still auto-pulled from the employee's Default Role on the
employee profile (planning.slot._compute_role_id reads
resource_id.default_role_id). Hiding the manual Role field declutters
the Add Shift dialog so the manager doesn't have to think about it on
each shift.

If a shift needs a one-off role override, an admin can still set it
via the backend list view or by editing the resource's default role.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 07:52:13 -04:00

29 lines
1.4 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Add "Apply Also To" m2m field to the Add Shift dialog so a
manager can create the same shift for many employees in one save. -->
<record id="planning_view_form_inherit_fusion_planning" model="ir.ui.view">
<field name="name">planning.slot.form.inherit.fusion_planning</field>
<field name="model">planning.slot</field>
<field name="inherit_id" ref="planning.planning_view_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='role_id']" position="after">
<field name="x_fc_additional_resource_ids"
widget="many2many_tags"
options="{'no_create': True, 'no_quick_create': True}"
placeholder="Pick more employees to apply this shift to"
invisible="id"
groups="planning.group_planning_manager"/>
</xpath>
<!-- Hide the manual Role field from the Add Shift dialog. Role is
still auto-pulled from the employee's Default Role on the
employee profile via planning.slot._compute_role_id. -->
<xpath expr="//field[@name='role_id']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
</field>
</record>
</odoo>