Two manager-side time savers on the Add Shift dialog: 1. Auto-publish on create Override planning.slot.create() to default state='published' for every new shift (was: 'draft', requiring a separate Publish step per slot — painful with recurrence which can generate dozens at a time). Recurrency-generated copies inherit the parent slot's state, so a single recurring shift now publishes the whole series in one save. Manager can still pass state='draft' explicitly to opt out. 2. Apply Also To (multi-resource bulk create) New x_fc_additional_resource_ids m2m on planning.slot. When set, create() splits the vals into one slot per additional resource (deduped against the primary). Combined with recurrence, picking N employees and a date range now creates the full N x M shift matrix in a single Save instead of N manual repeats. Field appears in the Add Shift dialog under Role, hidden once the slot is saved (it's a create-time helper, not ongoing data), and gated to planning.group_planning_manager. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
23 lines
1008 B
XML
23 lines
1008 B
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>
|
|
</field>
|
|
</record>
|
|
|
|
</odoo>
|