Reminders, absence detection, late/early penalties, and auto-clock-out are now driven by each employee's real schedule (posted planner entry -> recurring shift), never the global 9-5 default. Employees who aren't scheduled get no reminders/absence. Overtime past the scheduled end is never cut off — auto clock-out only fires at a max-shift safety cap (default raised 12 -> 16h). Team leads build the planner in draft and Post it (publishes + emails employees). - hr.employee._get_fclk_day_plan: explicit `scheduled` flag; posted-only planner entries (drafts ignored), else recurring shift covering that weekday, else not-scheduled; sources 'schedule'/'shift'/'none'. - fusion.clock.shift: day_mon..day_sun weekday pattern + covers_weekday(). - fusion.clock.schedule: draft/posted state + posted_date; planner edits reset to draft; fclk_email_posted_week notification. - Rewrote the reminder / absence / auto-clock-out crons: schedule-gated, per-employee savepoints, OT-aware cap, weekend hardcode removed. - Penalties + all three clock-in paths skip days the employee isn't scheduled. - shift_planner: Post Week route + planner Post button + draft count. - Migration backfills pre-existing schedule entries to 'posted' so they keep driving automation after upgrade. - Tests: resolver matrix, cron gating, OT cap; fixed the existing planner test for the new state/source semantics. Design: docs/superpowers/specs/2026-05-30-schedule-driven-attendance-design.md Frontend footprint kept at zero to avoid colliding with the concurrent employee-portal (payslips) work. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
73 lines
2.9 KiB
XML
73 lines
2.9 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
|
|
<!-- Shift List View -->
|
|
<record id="view_fusion_clock_shift_list" model="ir.ui.view">
|
|
<field name="name">fusion.clock.shift.list</field>
|
|
<field name="model">fusion.clock.shift</field>
|
|
<field name="arch" type="xml">
|
|
<list editable="bottom">
|
|
<field name="sequence" widget="handle"/>
|
|
<field name="name"/>
|
|
<field name="start_time" widget="float_time"/>
|
|
<field name="end_time" widget="float_time"/>
|
|
<field name="break_minutes"/>
|
|
<field name="employee_count"/>
|
|
<field name="company_id" groups="base.group_multi_company"/>
|
|
</list>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- Shift Form View -->
|
|
<record id="view_fusion_clock_shift_form" model="ir.ui.view">
|
|
<field name="name">fusion.clock.shift.form</field>
|
|
<field name="model">fusion.clock.shift</field>
|
|
<field name="arch" type="xml">
|
|
<form>
|
|
<sheet>
|
|
<group>
|
|
<group>
|
|
<field name="name"/>
|
|
<field name="start_time" widget="float_time"/>
|
|
<field name="end_time" widget="float_time"/>
|
|
<field name="break_minutes"/>
|
|
</group>
|
|
<group>
|
|
<field name="sequence"/>
|
|
<field name="active"/>
|
|
<field name="color" widget="color"/>
|
|
<field name="company_id" groups="base.group_multi_company"/>
|
|
</group>
|
|
</group>
|
|
<group string="Working Days" col="7">
|
|
<field name="day_mon"/>
|
|
<field name="day_tue"/>
|
|
<field name="day_wed"/>
|
|
<field name="day_thu"/>
|
|
<field name="day_fri"/>
|
|
<field name="day_sat"/>
|
|
<field name="day_sun"/>
|
|
</group>
|
|
<group string="Assigned Employees">
|
|
<field name="employee_ids" nolabel="1" colspan="2">
|
|
<list>
|
|
<field name="name"/>
|
|
<field name="department_id"/>
|
|
<field name="job_title"/>
|
|
</list>
|
|
</field>
|
|
</group>
|
|
</sheet>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- Shift Action -->
|
|
<record id="action_fusion_clock_shift" model="ir.actions.act_window">
|
|
<field name="name">Shifts</field>
|
|
<field name="res_model">fusion.clock.shift</field>
|
|
<field name="view_mode">list,form</field>
|
|
</record>
|
|
|
|
</odoo>
|