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

  1. <odoo>
  2. <!-- Attendance Sheet Shifts Views -->
  3. <record model="ir.ui.view" id="sheet_view_search">
  4. <field name="name">Attendance Sheet Search</field>
  5. <field name="model">beesdoo.shift.sheet</field>
  6. <field name="arch" type="xml">
  7. <search>
  8. <field name="day" />
  9. <field name="validated_by" />
  10. <filter string="Annotated (unread)"
  11. domain="[('is_annotated', '=', True),
  12. ('is_read', '=', False)]" />
  13. <filter string="Annotated (read)"
  14. domain="[('is_annotated', '=', True),
  15. ('is_read', '=', True)]" />
  16. <separator />
  17. <filter string="Archived"
  18. domain="[('active', '=', False)]" />
  19. <group expand="1" string="Group By">
  20. <filter string="Day" name="gb_day"
  21. context="{'group_by' : 'start_time:day'}" />
  22. </group>
  23. </search>
  24. </field>
  25. </record>
  26. <record model="ir.ui.view" id="sheet_expected_view_tree">
  27. <field name="name">Expected Shifts List</field>
  28. <field name="model">beesdoo.shift.sheet.expected</field>
  29. <field name="arch" type="xml">
  30. <tree editable="bottom" create="false" delete="false" open="false"
  31. decoration-danger="stage == 'absent_0' or stage == 'absent_1' or stage == 'absent_2'"
  32. decoration-success="stage == 'present'">
  33. <field name="task_type_id" readonly="True" options="{'no_open': True}"/>
  34. <field name="worker_id" readonly="True" options="{'no_open': True}"/>
  35. <field name="working_mode" />
  36. <field name="replacement_worker_id"
  37. attrs="{'readonly':
  38. [('working_mode','=','irregular')]}"
  39. options="{'no_create': True, 'no_create_edit':True}"/>
  40. <field name="stage"/>
  41. </tree>
  42. </field>
  43. </record>
  44. <record model="ir.ui.view" id="sheet_added_view_tree">
  45. <field name="view_mode">tree</field>
  46. <field name="name">Added Shifts List</field>
  47. <field name="model">beesdoo.shift.sheet.added</field>
  48. <field name="arch" type="xml">
  49. <tree editable="bottom"
  50. decoration-success="stage == 'present'">
  51. <field name="task_type_id"
  52. options="{'no_open': True, 'no_create': True, 'no_create_edit':True }" />
  53. <field name="worker_id"
  54. options="{'no_open': True, 'no_create': True, 'no_create_edit':True }" />
  55. <field name="working_mode" />
  56. <field name="regular_task_type"
  57. attrs="{'readonly':
  58. [('working_mode','=','irregular')]}"/>
  59. <field name="stage" readonly="True" />
  60. </tree>
  61. </field>
  62. </record>
  63. <record model="ir.ui.view" id="sheet_expected_view_form">
  64. <field name="view_mode">tree</field>
  65. <field name="name">Expected Shifts Form</field>
  66. <field name="model">beesdoo.shift.sheet.expected</field>
  67. <field name="arch" type="xml">
  68. <form readonly="True">
  69. <group string="Expected Shift" >
  70. <field name="task_type_id" options="{'no_open': True}" />
  71. <field name="worker_id" options="{'no_open': True}" />
  72. <field name="working_mode" options="{'no_open': True}" />
  73. <field name="replacement_worker_id" options="{'no_open': True}" />
  74. <field name="stage" options="{'no_open': True}" />
  75. </group>
  76. </form>
  77. </field>
  78. </record>
  79. <record model="ir.ui.view" id="sheet_added_view_form">
  80. <field name="view_mode">tree</field>
  81. <field name="name">Added Shifts Form</field>
  82. <field name="model">beesdoo.shift.sheet.added</field>
  83. <field name="arch" type="xml">
  84. <form readonly="True" >
  85. <group>
  86. <field name="task_type_id" options="{'no_open': True}" />
  87. <field name="worker_id" options="{'no_open': True}" />
  88. <field name="working_mode" options="{'no_open': True}" />
  89. <field name="regular_task_type" options="{'no_open': True}" />
  90. <field name="stage" options="{'no_open': True}" />
  91. </group>
  92. </form>
  93. </field>
  94. </record>
  95. <!-- Attendance Sheets Views -->
  96. <record model="ir.ui.view" id="sheet_view_tree">
  97. <field name="name">Attendance Sheet List</field>
  98. <field name="model">beesdoo.shift.sheet</field>
  99. <field name="arch" type="xml">
  100. <tree create="false" delete="false" decoration-danger="state == 'not_validated'">
  101. <field name="day" />
  102. <field name="time_slot" />
  103. <field name="max_worker_no" type="char"/>
  104. <field name="state" />
  105. <field name="validated_by" />
  106. <field name="is_annotated" />
  107. </tree>
  108. </field>
  109. </record>
  110. <record model="ir.ui.view" id="sheet_view_form">
  111. <field name="name">Attendance Sheet Form</field>
  112. <field name="model">beesdoo.shift.sheet</field>
  113. <field name="arch" type="xml">
  114. <form create="false" delete="false">
  115. <field name="_barcode_scanned" widget="barcode_handler"/>
  116. <header>
  117. <div>
  118. <field name="state" widget="statusbar" readonly="True" class="oe_inline"/>
  119. <button type="object"
  120. name="validate_via_wizard"
  121. string="Validate Sheet"
  122. attrs="{'invisible': [('state', '=', 'validated')]}"
  123. />
  124. </div>
  125. <div class="oe_clear" />
  126. </header>
  127. <sheet>
  128. <div class="oe_button_box" name="button_box">
  129. <button name="button_mark_as_read" type="object"
  130. class="oe_stat_button" icon="fa-check"
  131. string="Mark as read"
  132. groups="beesdoo_shift.group_cooperative_admin"
  133. />
  134. <button name="toggle_active"
  135. type="object"
  136. groups="beesdoo_shift.group_cooperative_admin"
  137. class="oe_stat_button"
  138. icon="fa-archive">
  139. <field name="active" widget="boolean_button" options='{"terminology": "archive"}'/>
  140. </button>
  141. </div>
  142. <div class="oe_title">
  143. <h1>
  144. <field name="time_slot" />
  145. </h1>
  146. </div>
  147. <group>
  148. <field name="max_worker_no" />
  149. </group>
  150. <separator string="Added workers" />
  151. <field name="added_shift_ids"/>
  152. <separator string="Expected workers" />
  153. <field name="expected_shift_ids" />
  154. <br/>
  155. <group col="1" string="Feedback"
  156. groups="beesdoo_shift.group_cooperative_admin">
  157. <field name="annotation" />
  158. <br/>
  159. <field name="feedback" />
  160. <br/>
  161. <field name="worker_nb_feedback" />
  162. <br/>
  163. <group>
  164. <field name="validated_by" readonly="True"/>
  165. </group>
  166. </group>
  167. </sheet>
  168. <div class="oe_chatter">
  169. <field name="message_ids"
  170. widget="mail_thread"
  171. groups="beesdoo_shift.group_cooperative_admin"
  172. />
  173. </div>
  174. </form>
  175. </field>
  176. </record>
  177. <!-- Actions -->
  178. <!-- This method would be better but library "fields" is not imported -->
  179. <!--
  180. domain="[('end_time','&gt;',fields.Datetime.to_string(datetime.date.today())),
  181. ('start_time','&lt;', fields.Datetime.to_string(datetime.date.today() + datetime.timedelta(days=1)))]" -->
  182. <act_window id="action_sheet_daily"
  183. name="Daily attendance sheets"
  184. res_model="beesdoo.shift.sheet"
  185. view_mode="tree,form"
  186. domain="[('end_time','&gt;', datetime.date.today().strftime('%Y-%m-%d 00:00:00')),
  187. ('start_time','&lt;', datetime.date.today().strftime('%Y-%m-%d 23:59:59'))]"
  188. />
  189. <!-- Top menu item -->
  190. <menuitem id="menu_sheet_top"
  191. name="Attendance Sheets"
  192. parent="menu_root"
  193. groups="beesdoo_shift.group_shift_attendance_sheet"
  194. />
  195. <!-- Menu actions -->
  196. <menuitem id="menu_sheet"
  197. name="Daily attendance sheets"
  198. parent="menu_sheet_top"
  199. action="action_sheet_daily"
  200. sequence="2"
  201. />
  202. </odoo>