feat(fusion_planning): add Employee Roles editor under Planning > Configuration

New menu "Planning > Configuration > Employee Roles" opens an editable
list of all active employees with two columns made for fast bulk
assignment:
- Default Role (m2o, fills new shifts automatically)
- All Allowed Roles (m2m tags, controls open-shift visibility)

Per-row inline editing with multi_edit enabled, grouped by department.
No wizard, no popup — set role per employee in one screen and move on.

Visible to planning.group_planning_manager.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsinghpal
2026-05-07 08:04:23 -04:00
parent b7817b752c
commit 6c6a59ceef
2 changed files with 61 additions and 1 deletions

View File

@@ -5,7 +5,7 @@
{
'name': 'Fusion Planning',
'version': '19.0.1.1.1',
'version': '19.0.1.2.0',
'category': 'Human Resources/Planning',
'summary': 'Fusion Clock bridge to Odoo Planning - employee schedule on the portal',
'description': """
@@ -27,6 +27,7 @@ Adds Odoo Planning to the Fusion Clock product family:
],
'data': [
'views/planning_slot_views.xml',
'views/hr_employee_role_views.xml',
'views/portal_schedule_templates.xml',
'views/portal_nav_inherit.xml',
],

View File

@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Editable list view for fast bulk-assignment of planning roles per employee. -->
<record id="hr_employee_view_list_planning_role_editor" model="ir.ui.view">
<field name="name">hr.employee.list.planning.role.editor</field>
<field name="model">hr.employee</field>
<field name="arch" type="xml">
<list string="Employee Roles"
editable="bottom"
multi_edit="1"
default_order="department_id, name">
<field name="name" readonly="1"/>
<field name="job_title" readonly="1" optional="show"/>
<field name="department_id" readonly="1" optional="show"/>
<field name="default_planning_role_id"
string="Default Role"
options="{'no_quick_create': True}"
widget="many2one"/>
<field name="planning_role_ids"
string="All Allowed Roles"
widget="many2many_tags"
options="{'no_quick_create': True, 'color_field': 'color'}"
optional="show"/>
<field name="active" column_invisible="1"/>
</list>
</field>
</record>
<!-- Action: open hr.employee filtered to active, in our editable list view -->
<record id="hr_employee_action_planning_role_editor" model="ir.actions.act_window">
<field name="name">Employee Roles</field>
<field name="res_model">hr.employee</field>
<field name="view_mode">list</field>
<field name="view_id" ref="hr_employee_view_list_planning_role_editor"/>
<field name="domain">[('active', '=', True)]</field>
<field name="context">{'search_default_group_department': 1}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Set the Default Role and allowed Roles for each employee
</p>
<p>
Click any cell under <b>Default Role</b> or <b>All Allowed Roles</b>
and start typing. Changes save automatically. The Default Role
fills in for every new shift you create for that employee.
</p>
</field>
</record>
<!-- Menu item under Planning → Configuration -->
<menuitem
id="planning_menu_settings_employee_roles"
name="Employee Roles"
parent="planning.planning_menu_settings"
sequence="13"
action="hr_employee_action_planning_role_editor"
groups="planning.group_planning_manager"/>
</odoo>