You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

215 lines
9.4 KiB

<odoo>
<!-- Attendance Sheet Shifts Views -->
<record model="ir.ui.view" id="sheet_view_search">
<field name="name">Attendance Sheet Search</field>
<field name="model">beesdoo.shift.sheet</field>
<field name="arch" type="xml">
<search>
<field name="day" />
<field name="validated_by" />
<filter string="Annotated (unread)"
domain="[('is_annotated', '=', True),
('is_read', '=', False)]" />
<filter string="Annotated (read)"
domain="[('is_annotated', '=', True),
('is_read', '=', True)]" />
<separator />
<filter string="Archived"
domain="[('active', '=', False)]" />
<group expand="1" string="Group By">
<filter string="Day" name="gb_day"
context="{'group_by' : 'start_time:day'}" />
</group>
</search>
</field>
</record>
<record model="ir.ui.view" id="sheet_expected_view_tree">
<field name="name">Expected Shifts List</field>
<field name="model">beesdoo.shift.sheet.expected</field>
<field name="arch" type="xml">
<tree editable="bottom" create="false" delete="false" open="false"
decoration-danger="stage == 'absent_0' or stage == 'absent_1' or stage == 'absent_2'"
decoration-success="stage == 'present'">
<field name="task_type_id" readonly="True" options="{'no_open': True}"/>
<field name="worker_id" readonly="True" options="{'no_open': True}"/>
<field name="working_mode" />
<field name="replacement_worker_id"
attrs="{'readonly':
[('working_mode','=','irregular')]}"
options="{'no_create': True, 'no_create_edit':True}"/>
<field name="stage"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="sheet_added_view_tree">
<field name="view_mode">tree</field>
<field name="name">Added Shifts List</field>
<field name="model">beesdoo.shift.sheet.added</field>
<field name="arch" type="xml">
<tree editable="bottom"
decoration-success="stage == 'present'">
<field name="task_type_id"
options="{'no_open': True, 'no_create': True, 'no_create_edit':True }" />
<field name="worker_id"
options="{'no_open': True, 'no_create': True, 'no_create_edit':True }" />
<field name="working_mode" />
<field name="regular_task_type"
attrs="{'readonly':
[('working_mode','=','irregular')]}"/>
<field name="stage" readonly="True" />
</tree>
</field>
</record>
<record model="ir.ui.view" id="sheet_expected_view_form">
<field name="view_mode">tree</field>
<field name="name">Expected Shifts Form</field>
<field name="model">beesdoo.shift.sheet.expected</field>
<field name="arch" type="xml">
<form readonly="True">
<group string="Expected Shift" >
<field name="task_type_id" options="{'no_open': True}" />
<field name="worker_id" options="{'no_open': True}" />
<field name="working_mode" options="{'no_open': True}" />
<field name="replacement_worker_id" options="{'no_open': True}" />
<field name="stage" options="{'no_open': True}" />
</group>
</form>
</field>
</record>
<record model="ir.ui.view" id="sheet_added_view_form">
<field name="view_mode">tree</field>
<field name="name">Added Shifts Form</field>
<field name="model">beesdoo.shift.sheet.added</field>
<field name="arch" type="xml">
<form readonly="True" >
<group>
<field name="task_type_id" options="{'no_open': True}" />
<field name="worker_id" options="{'no_open': True}" />
<field name="working_mode" options="{'no_open': True}" />
<field name="regular_task_type" options="{'no_open': True}" />
<field name="stage" options="{'no_open': True}" />
</group>
</form>
</field>
</record>
<!-- Attendance Sheets Views -->
<record model="ir.ui.view" id="sheet_view_tree">
<field name="name">Attendance Sheet List</field>
<field name="model">beesdoo.shift.sheet</field>
<field name="arch" type="xml">
<!-- <tree create="false" delete="false" decoration-danger="stage == 'absent'"> -->
<tree create="false" decoration-danger="state == 'not_validated'">
<field name="name"/>
<field name="max_worker_no" type="char"/>
<field name="state" />
<field name="validated_by" />
<field name="is_annotated" />
</tree>
</field>
</record>
<record model="ir.ui.view" id="sheet_view_form">
<field name="name">Attendance Sheet Form</field>
<field name="model">beesdoo.shift.sheet</field>
<field name="arch" type="xml">
<form create="false" delete="false">
<field name="_barcode_scanned" widget="barcode_handler"/>
<header>
<div>
<field name="state" widget="statusbar" readonly="True" class="oe_inline"/>
<button type="object"
name="validate_via_wizard"
string="Validate Sheet"
attrs="{'invisible': [('state', '=', 'validated')]}"
/>
</div>
<div class="oe_clear" />
</header>
<sheet>
<div class="oe_button_box" name="button_box">
<button name="button_mark_as_read" type="object"
class="oe_stat_button" icon="fa-check"
string="Mark as read"
groups="beesdoo_shift.group_cooperative_admin"
/>
<button name="toggle_active"
type="object"
groups="beesdoo_shift.group_cooperative_admin"
class="oe_stat_button"
icon="fa-archive">
<field name="active" widget="boolean_button" options='{"terminology": "archive"}'/>
</button>
</div>
<div class="oe_title">
<h1>
<field name="time_slot" />
</h1>
</div>
<group>
<field name="max_worker_no" />
</group>
<separator string="Added workers" />
<field name="added_shift_ids"/>
<separator string="Expected workers" />
<field name="expected_shift_ids" />
<br/>
<group col="1" string="Feedback"
groups="beesdoo_shift.group_cooperative_admin">
<field name="annotation" />
<br/>
<field name="feedback" />
<br/>
<field name="worker_nb_feedback" />
<br/>
<group>
<field name="validated_by" readonly="True"/>
</group>
</group>
</sheet>
<div class="oe_chatter">
<field name="message_ids"
widget="mail_thread"
groups="beesdoo_shift.group_cooperative_admin"
/>
</div>
</form>
</field>
</record>
<!-- Actions -->
<!-- This method would be better but library "fields" is not imported -->
<!--
domain="[('end_time','&gt;',fields.Datetime.to_string(datetime.date.today())),
('start_time','&lt;', fields.Datetime.to_string(datetime.date.today() + datetime.timedelta(days=1)))]" -->
<act_window id="action_sheet_daily"
name="Daily attendance sheets"
res_model="beesdoo.shift.sheet"
view_mode="tree,form"
domain="[('end_time','&gt;', datetime.date.today().strftime('%Y-%m-%d 00:00:00')),
('start_time','&lt;', datetime.date.today().strftime('%Y-%m-%d 23:59:59'))]"
/>
<!-- Top menu item -->
<menuitem id="menu_sheet_top"
name="Attendance Sheets"
parent="menu_root"
groups="beesdoo_shift.group_shift_attendance_sheet"
/>
<!-- Menu actions -->
<menuitem id="menu_sheet"
name="Daily attendance sheets"
parent="menu_sheet_top"
action="action_sheet_daily"
sequence="2"
/>
</odoo>