This commit is contained in:
gsinghpal
2026-04-26 15:05:17 -04:00
parent 160198edb1
commit d9f58b9851
110 changed files with 6210 additions and 1182 deletions

View File

@@ -0,0 +1,165 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2026 Nexa Systems Inc.
License OPL-1 (Odoo Proprietary License v1.0)
Part of the Fusion Plating product family.
-->
<odoo>
<record id="view_fp_work_role_list" model="ir.ui.view">
<field name="name">fp.work.role.list</field>
<field name="model">fp.work.role</field>
<field name="arch" type="xml">
<list editable="bottom">
<field name="sequence" widget="handle"/>
<field name="code"/>
<field name="name"/>
<field name="icon" optional="show"/>
<field name="description"/>
<field name="active" widget="boolean_toggle"/>
</list>
</field>
</record>
<record id="view_fp_work_role_form" model="ir.ui.view">
<field name="name">fp.work.role.form</field>
<field name="model">fp.work.role</field>
<field name="arch" type="xml">
<form>
<sheet>
<div class="oe_title">
<label for="name"/>
<h1><field name="name" placeholder="e.g. Plating Operator"/></h1>
</div>
<group>
<group>
<field name="code" placeholder="plating_op"/>
<field name="icon"/>
<field name="sequence"/>
</group>
<group>
<field name="active" widget="boolean_toggle"/>
<field name="mastery_required"/>
</group>
</group>
<group>
<field name="description"
placeholder="Short operator-facing description of what this role covers."/>
</group>
<div class="alert alert-info" role="alert">
<i class="fa fa-info-circle me-1"/>
<strong>Mastery Threshold</strong> controls auto-promotion: when an
operator has finished this many WOs against this role, the role is
added to their Shop Roles automatically and a chatter line is
posted to their employee record. Defaults from
<em>Settings &gt; Fusion Plating &gt; Default Mastery Threshold</em>.
</div>
</sheet>
</form>
</field>
</record>
<record id="action_fp_work_role" model="ir.actions.act_window">
<field name="name">Shop Roles</field>
<field name="res_model">fp.work.role</field>
<field name="view_mode">list,form</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Define the roles on your shop floor
</p>
<p>
Tag each employee with the roles they can perform and tag each
recipe step with the role that performs it. Work orders will
auto-route to the right worker when an MO is confirmed.
</p>
</field>
</record>
<menuitem id="menu_fp_work_roles"
name="Shop Roles"
parent="fusion_plating.menu_fp_config"
action="action_fp_work_role"
sequence="55"
groups="fusion_plating.group_fusion_plating_manager"/>
<!-- Employee form — Shop Roles + Lead Hand For + Proficiency tracker -->
<record id="view_hr_employee_form_fp_roles" model="ir.ui.view">
<field name="name">hr.employee.form.fp.roles</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="arch" type="xml">
<xpath expr="//notebook" position="inside">
<page string="Shop Roles" name="fp_shop_roles"
groups="fusion_plating.group_fusion_plating_supervisor">
<group>
<group string="Tasks This Operator Can Do">
<field name="x_fc_work_role_ids"
widget="many2many_tags"
options="{'no_create_edit': True}"
placeholder="Tag the shop roles this employee performs..."/>
<div class="text-muted small" colspan="2">
Work orders tagged with these roles auto-assign to
this employee (or to whoever has the same role and
the lighter open queue).
</div>
</group>
<group string="Lead Hand For"
groups="fusion_plating.group_fusion_plating_manager">
<field name="x_fc_lead_hand_role_ids"
widget="many2many_tags"
options="{'no_create_edit': True}"
placeholder="Roles where this employee can cover for absent operators..."/>
<div class="text-muted small" colspan="2">
Lead hands appear at the top of the Manager Desk
worker dropdown for these roles, even when they
aren't the primary owner. Use for cross-trained
workers who can step in during absences.
</div>
</group>
</group>
<separator string="Task Proficiency"/>
<p class="text-muted small">
Auto-tracked: every successfully completed WO bumps the
count for its role. When the count crosses the role's
mastery threshold the role is added to <em>Tasks This
Operator Can Do</em> automatically.
</p>
<field name="x_fc_proficiency_ids" nolabel="1"
readonly="1">
<list>
<field name="role_id"/>
<field name="completed_count"/>
<field name="progress_label" string="Progress"/>
<field name="promoted" widget="boolean_toggle"
readonly="1"/>
<field name="first_completed_at"/>
<field name="last_completed_at"/>
<field name="promoted_at"/>
</list>
</field>
</page>
</xpath>
</field>
</record>
<!-- Process node form — add role field -->
<record id="view_fp_process_node_form_fp_roles" model="ir.ui.view">
<field name="name">fusion.plating.process.node.form.fp.roles</field>
<field name="model">fusion.plating.process.node</field>
<field name="inherit_id" ref="fusion_plating.view_fp_process_node_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='work_center_id']" position="after">
<field name="x_fc_work_role_id"
options="{'no_create_edit': True}"/>
</xpath>
</field>
</record>
<!--
NOTE: the WO form already shows x_fc_work_role_id + x_fc_assigned_user_id
via mrp_workorder_views.xml (after production_id). The earlier inherit
here would cause the fields to render twice.
-->
</odoo>