Elouan Le Bars
5 years ago
3 changed files with 189 additions and 0 deletions
-
2beesdoo_shift/__openerp__.py
-
132beesdoo_shift/views/attendance_sheet.xml
-
55beesdoo_shift/views/attendance_sheet_admin.xml
@ -0,0 +1,132 @@ |
|||
<odoo> |
|||
|
|||
<!-- Attendance Sheet Shifts Views --> |
|||
|
|||
<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="top" create="false" delete="false"> |
|||
<field name="task_type_id" readonly="True"/> |
|||
<field name="worker_id" readonly="True"/> |
|||
<field name="working_mode" /> |
|||
<field name="replacement_worker_id" |
|||
attrs="{'readonly': |
|||
[('working_mode','=','irregular')]}"/> |
|||
<field name="stage" /> |
|||
<field name="compensation_nb" |
|||
attrs="{'readonly': |
|||
['|', |
|||
('working_mode','=','irregular'), |
|||
('stage','in',['present','cancelled'])]}"/> |
|||
</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="top"> |
|||
<field name="task_type_id" /> |
|||
<field name="worker_id" /> |
|||
<field name="working_mode" /> |
|||
<field name="regular_task_type" |
|||
attrs="{'readonly': |
|||
[('working_mode','=','irregular')]}"/> |
|||
<field name="stage" readonly="True" /> |
|||
</tree> |
|||
</field> |
|||
</record> |
|||
|
|||
<!-- Attendance Sheets Views --> |
|||
|
|||
<record model="ir.ui.view" id="sheet_view_tree"> |
|||
<field name="name">Daily Attendance Sheets List</field> |
|||
<field name="model">beesdoo.shift.sheet</field> |
|||
<field name="arch" type="xml"> |
|||
<!-- <tree create="false" delete="false"> --> |
|||
<tree create="false" > |
|||
<field name="name"/> |
|||
<field name="max_worker_nb" 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"> |
|||
<header> |
|||
<field name="state" widget="statusbar" readonly="True" /> |
|||
</header> |
|||
<sheet> |
|||
<div class="oe_title"> |
|||
<h1><field name="name" /></h1> |
|||
</div> |
|||
<group> |
|||
<field name="max_worker_nb" /> |
|||
</group> |
|||
<h2> Expected workers </h2> |
|||
<group> |
|||
<field name="expected_worker_nb" /> |
|||
</group> |
|||
<field name="expected_shift_ids" /> |
|||
<h2> Added workers </h2> |
|||
<group> |
|||
<field name="added_worker_nb" /> |
|||
</group> |
|||
<field name="added_shift_ids" /> |
|||
<h4> Additional important informations </h4> |
|||
<field name="annotation" /> |
|||
<group> |
|||
<field name="is_read" /> |
|||
</group> |
|||
<h4> General feedback </h4> |
|||
<field name="feedback" /> |
|||
<group> |
|||
<field name="worker_nb_feedback"/> |
|||
</group> |
|||
<group> |
|||
<field name="validated_by" readonly="True" /> |
|||
</group> |
|||
</sheet> |
|||
<div class="oe_chatter"> |
|||
<field name="message_ids" widget="mail_thread"/> |
|||
</div> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
|
|||
<!-- Actions --> |
|||
<!-- This method would be better but library "fields" is not imported --> |
|||
<!-- |
|||
domain="[('end_time','>',fields.Datetime.to_string(datetime.date.today())), |
|||
('start_time','<', 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','>', datetime.date.today().strftime('%Y-%m-%d 00:00:00')), |
|||
('start_time','<', datetime.date.today().strftime('%Y-%m-%d 23:59:59'))]" |
|||
/> |
|||
|
|||
<!-- Top menu item --> |
|||
<menuitem id="menu_sheet_top" |
|||
name="Attendance Sheets" |
|||
parent="menu_root" |
|||
/> |
|||
|
|||
<!-- Menu actions --> |
|||
<menuitem id="menu_sheet" |
|||
name="Daily attendance sheets" |
|||
parent="menu_sheet_top" |
|||
action="action_sheet_daily" |
|||
/> |
|||
|
|||
</odoo> |
@ -0,0 +1,55 @@ |
|||
<odoo> |
|||
<!-- |
|||
<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> |
|||
</search> |
|||
</field> |
|||
</record> |
|||
--> |
|||
|
|||
<act_window id="action_sheet_admin_non_validated" |
|||
name="Non-validated sheets" |
|||
res_model="beesdoo.shift.sheet" |
|||
view_mode="tree,form" |
|||
domain="[('state','=','not_validated')]" |
|||
/> |
|||
<!-- Annotated sheets should display only the both annotated and validated ones--> |
|||
<act_window id="action_sheet_admin_annotated" |
|||
name="Unread annotations" |
|||
res_model="beesdoo.shift.sheet" |
|||
view_mode="tree,form" |
|||
domain="[('is_annotated','=',True), |
|||
('is_read','=',False)]" |
|||
/> |
|||
<act_window id="action_sheet_admin_list" |
|||
name="All sheets" |
|||
res_model="beesdoo.shift.sheet" |
|||
view_mode="tree,form" |
|||
/> |
|||
|
|||
<!-- Top menu item --> |
|||
<menuitem id="menu_sheet_admin_top" |
|||
name="Attendance Sheets Administration" |
|||
parent="menu_root" |
|||
/> |
|||
|
|||
<!-- Menu actions --> |
|||
<menuitem id="menu_sheet_admin_non_validated" |
|||
name="Non-validated sheets" |
|||
parent="menu_sheet_admin_top" |
|||
action="action_sheet_admin_non_validated" |
|||
/> |
|||
<menuitem id="menu_sheet_admin_annotated" |
|||
name="Unread annotations" |
|||
parent="menu_sheet_admin_top" |
|||
action="action_sheet_admin_annotated" |
|||
/> |
|||
<menuitem id="menu_sheet_admin_list" |
|||
name="All sheets" |
|||
parent="menu_sheet_admin_top" |
|||
action="action_sheet_admin_list" |
|||
/> |
|||
</odoo> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue