Browse Source

[IMP] b_shift : attendance sheet form view

pull/125/head
Elouan Le Bars 5 years ago
parent
commit
de16bca2c5
  1. 11
      beesdoo_shift/models/attendance_sheet.py
  2. 66
      beesdoo_shift/views/attendance_sheet.xml
  3. 4
      beesdoo_shift/wizard/validate_attendance_sheet.xml

11
beesdoo_shift/models/attendance_sheet.py

@ -151,7 +151,6 @@ class AttendanceSheet(models.Model):
default="not_validated", default="not_validated",
track_visibility="onchange", track_visibility="onchange",
) )
start_time = fields.Datetime( start_time = fields.Datetime(
string="Start Time", required=True, readonly=True string="Start Time", required=True, readonly=True
) )
@ -167,8 +166,7 @@ class AttendanceSheet(models.Model):
"attendance_sheet_id", "attendance_sheet_id",
string="Added Shifts", string="Added Shifts",
) )
max_worker_nb = fields.Integer(
max_worker_no = fields.Integer(
string="Maximum number of workers", string="Maximum number of workers",
default=0, default=0,
readonly=True, readonly=True,
@ -185,7 +183,7 @@ class AttendanceSheet(models.Model):
) )
annotation = fields.Text( annotation = fields.Text(
"Attendance Sheet annotation", default="", track_visibility="onchange"
"Annotation", default=""
) )
is_annotated = fields.Boolean( is_annotated = fields.Boolean(
compute="_compute_is_annotated", compute="_compute_is_annotated",
@ -200,7 +198,7 @@ class AttendanceSheet(models.Model):
track_visibility="onchange", track_visibility="onchange",
) )
feedback = fields.Text( feedback = fields.Text(
"Attendance Sheet feedback", track_visibility="onchange"
"Feedback"
) )
worker_nb_feedback = fields.Selection( worker_nb_feedback = fields.Selection(
[ [
@ -208,8 +206,7 @@ class AttendanceSheet(models.Model):
("enough", "Enough"), ("enough", "Enough"),
("too_many", "Too many"), ("too_many", "Too many"),
], ],
string="Feedback regarding the number of workers.",
track_visibility="onchange",
string="Number of workers.",
) )
attended_worker_nb = fields.Integer( attended_worker_nb = fields.Integer(
string="Number of attended workers", string="Number of attended workers",

66
beesdoo_shift/views/attendance_sheet.xml

@ -41,6 +41,40 @@
</field> </field>
</record> </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 --> <!-- Attendance Sheets Views -->
<record model="ir.ui.view" id="sheet_view_tree"> <record model="ir.ui.view" id="sheet_view_tree">
@ -65,11 +99,13 @@
<form create="false" delete="false"> <form create="false" delete="false">
<field name="_barcode_scanned" widget="barcode_handler"/> <field name="_barcode_scanned" widget="barcode_handler"/>
<header> <header>
<div>
<field name="state" widget="statusbar" readonly="True" /> <field name="state" widget="statusbar" readonly="True" />
<button type="object" <button type="object"
name="validate_via_wizard" name="validate_via_wizard"
string="Validate Sheet" string="Validate Sheet"
/> />
</div>
</header> </header>
<sheet> <sheet>
<div class="oe_button_box" name="button_box"> <div class="oe_button_box" name="button_box">
@ -87,28 +123,26 @@
</button> </button>
</div> </div>
<div class="oe_title"> <div class="oe_title">
<h1><field name="name"/></h1>
<h1>
<field name="name" />
</h1>
</div> </div>
<group>
<field name="max_worker_nb" />
</group>
<group col="1" string="Expected workers">
<group>
<field name="expected_worker_nb" />
</group>
<field name="expected_shift_ids"/>
</group>
<group col="1" string="Added workers">
<group>
<field name="added_worker_nb" />
</group>
<field name="added_shift_ids" />
<separator string="Expected workers" />
<field name="expected_shift_ids" />
<separator string="Added workers" />
<field name="added_shift_ids"/>
<group string="Informations">
<field name="max_worker_no" />
</group> </group>
<group col="1" string="Informations"
<br/>
<group col="1" string="Feedback"
groups="beesdoo_shift.group_cooperative_admin"> groups="beesdoo_shift.group_cooperative_admin">
<field name="annotation" /> <field name="annotation" />
<br/>
<field name="feedback" /> <field name="feedback" />
<br/>
<field name="worker_nb_feedback" /> <field name="worker_nb_feedback" />
<br/>
<group> <group>
<field name="validated_by" readonly="True"/> <field name="validated_by" readonly="True"/>
</group> </group>

4
beesdoo_shift/wizard/validate_attendance_sheet.xml

@ -5,9 +5,7 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<form> <form>
<sheet> <sheet>
<div class="oe_title">
<h1>Validation</h1>
</div>
<separator string="Validation"/>
<label string="Beware : a validated sheet cannot be edited anymore <label string="Beware : a validated sheet cannot be edited anymore
and you won't be able to add any latecomers. and you won't be able to add any latecomers.
Emails will be sent to workers who did not attend their shift." /> Emails will be sent to workers who did not attend their shift." />

Loading…
Cancel
Save