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.

262 lines
12 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. name="annotated"
  12. domain="[('is_annotated', '=', True),
  13. ('is_read', '=', False)]" />
  14. <filter string="Annotated (read)"
  15. name="annotated_read"
  16. domain="[('is_annotated', '=', True),
  17. ('is_read', '=', True)]" />
  18. <separator />
  19. <filter string="Archived"
  20. name="archived"
  21. domain="[('active', '=', False)]" />
  22. <group expand="1" string="Group By">
  23. <filter string="Day" name="gb_day"
  24. context="{'group_by' : 'start_time:day'}" />
  25. <filter string="Feedback on number of workers"
  26. name="gb_worker_nb_feedback"
  27. context="{'group_by' : 'worker_nb_feedback'}" />
  28. </group>
  29. </search>
  30. </field>
  31. </record>
  32. <record model="ir.ui.view" id="sheet_expected_view_tree">
  33. <field name="name">Expected Shifts List</field>
  34. <field name="model">beesdoo.shift.sheet.expected</field>
  35. <field name="arch" type="xml">
  36. <tree create="false"
  37. decoration-danger="state in ['absent_0', 'absent_1', 'absent_2'] "
  38. decoration-success="state == 'done'">
  39. <field name="task_type_id" readonly="True" options="{'no_open': True}"/>
  40. <field name="super_coop_id" readonly="True" options="{'no_open': True}"/>
  41. <field name="worker_id" readonly="True" options="{'no_open': True}"/>
  42. <field name="working_mode" />
  43. <field name="replaced_id" readonly="True"/>
  44. <field name="state" readonly="True" />
  45. </tree>
  46. </field>
  47. </record>
  48. <record model="ir.ui.view" id="sheet_added_view_tree">
  49. <field name="view_mode">tree</field>
  50. <field name="name">Added Shifts List</field>
  51. <field name="model">beesdoo.shift.sheet.added</field>
  52. <field name="arch" type="xml">
  53. <tree decoration-danger="state in ['absent_0', 'absent_1', 'absent_2'] "
  54. decoration-success="state == 'done'">
  55. <field name="task_type_id"
  56. options="{'no_open': True, 'no_create': True, 'no_create_edit':True }" />
  57. <field name="worker_id"
  58. domain="[
  59. ('eater', '=', 'worker_eater'),
  60. ('working_mode', 'in', ('regular', 'irregular')),
  61. ('state', 'not in', ('unsubscribed', 'resigning')),
  62. ]"
  63. options="{'no_open': True, 'no_create': True, 'no_create_edit':True }" />
  64. <field name="working_mode" />
  65. <field name="is_compensation"
  66. attrs="{'invisible':
  67. [('working_mode','=','irregular')]}"/>
  68. <field name="state"/>
  69. </tree>
  70. </field>
  71. </record>
  72. <record model="ir.ui.view" id="sheet_expected_view_form">
  73. <field name="view_mode">tree</field>
  74. <field name="name">Expected Shifts Form</field>
  75. <field name="model">beesdoo.shift.sheet.expected</field>
  76. <field name="arch" type="xml">
  77. <form readonly="True">
  78. <group string="Expected Shift">
  79. <field name="task_type_id" readonly="True" options="{'no_open': True}"/>
  80. <field name="worker_id" readonly="True" options="{'no_open': True}"/>
  81. <field name="working_mode" />
  82. <field name="replaced_id"
  83. attrs="{'invisible':
  84. [('working_mode','=','irregular')]}"
  85. options="{'no_create': True, 'no_create_edit':True}"/>
  86. <field name="state" />
  87. </group>
  88. </form>
  89. </field>
  90. </record>
  91. <record model="ir.ui.view" id="sheet_added_view_form">
  92. <field name="view_mode">tree</field>
  93. <field name="name">Added Shifts Form</field>
  94. <field name="model">beesdoo.shift.sheet.added</field>
  95. <field name="arch" type="xml">
  96. <form readonly="True" >
  97. <group>
  98. <field name="task_type_id"
  99. options="{'no_open': True, 'no_create': True, 'no_create_edit':True }" />
  100. <field name="worker_id"
  101. domain="[
  102. ('eater', '=', 'worker_eater'),
  103. ('working_mode', 'in', ('regular', 'irregular')),
  104. ('state', 'not in', ('unsubscribed', 'resigning')),
  105. ]"
  106. options="{'no_open': True, 'no_create': True, 'no_create_edit':True }" />
  107. <field name="working_mode" />
  108. <field name="is_compensation"
  109. attrs="{'invisible':
  110. [('working_mode','=','irregular')]}"/>
  111. <field name="state"/>
  112. </group>
  113. </form>
  114. </field>
  115. </record>
  116. <!-- Attendance Sheets Views -->
  117. <record model="ir.ui.view" id="sheet_view_tree">
  118. <field name="name">Attendance Sheet List</field>
  119. <field name="model">beesdoo.shift.sheet</field>
  120. <field name="arch" type="xml">
  121. <tree create="false" delete="false" decoration-danger="state == 'not_validated'">
  122. <field name="week" />
  123. <field name="day" />
  124. <field name="time_slot" />
  125. <field name="max_worker_no" type="char"/>
  126. <field name="state" />
  127. <field name="validated_by" />
  128. <field name="attended_worker_no" type="char"/>
  129. <field name="is_annotated" />
  130. </tree>
  131. </field>
  132. </record>
  133. <record model="ir.ui.view" id="sheet_view_form">
  134. <field name="name">Attendance Sheet Form</field>
  135. <field name="model">beesdoo.shift.sheet</field>
  136. <field name="arch" type="xml">
  137. <form create="false" delete="false">
  138. <field name="_barcode_scanned" widget="barcode_handler"/>
  139. <header>
  140. <field name="state" widget="statusbar" readonly="True"/>
  141. <button type="object"
  142. name="validate_with_checks"
  143. string="Validate Sheet"
  144. confirm="Beware : a validated sheet cannot be edited anymore
  145. and you won't be able to add any latecomers.
  146. The counters of those who didn't attend will be updated
  147. and they will get warning emails."
  148. attrs="{'invisible': [('state', '=', 'validated')]}"
  149. />
  150. </header>
  151. <sheet>
  152. <div class="oe_button_box" name="button_box">
  153. <button name="button_mark_as_read" type="object"
  154. class="oe_stat_button" icon="fa-check"
  155. string="Mark as read"
  156. groups="beesdoo_shift.group_shift_attendance"/>
  157. <button name="toggle_active"
  158. type="object"
  159. groups="beesdoo_shift.group_shift_attendance"
  160. class="oe_stat_button"
  161. icon="fa-archive">
  162. <field name="active" widget="boolean_button" options='{"terminology": "archive"}'/>
  163. </button>
  164. </div>
  165. <separator string="Expected Shifts"/>
  166. <field name="expected_shift_ids" />
  167. <separator string="Added Shifts"/>
  168. <field name="added_shift_ids" />
  169. <group>
  170. <field name="max_worker_no" />
  171. </group>
  172. <group string="Feedback"
  173. groups="beesdoo_shift.group_shift_attendance">
  174. <field name="attended_worker_no" />
  175. <field name="notes" />
  176. <field name="feedback" />
  177. <field name="worker_nb_feedback" />
  178. <field name="validated_by" readonly="True"/>
  179. </group>
  180. </sheet>
  181. <div class="oe_chatter">
  182. <field name="message_ids"
  183. widget="mail_thread"
  184. groups="beesdoo_shift.group_shift_attendance"
  185. />
  186. </div>
  187. </form>
  188. </field>
  189. </record>
  190. <!-- Actions -->
  191. <act_window id="action_sheet_admin_non_validated"
  192. name="Non-validated sheets"
  193. res_model="beesdoo.shift.sheet"
  194. view_mode="tree,form"
  195. domain="[('state','=','not_validated')]"
  196. />
  197. <!-- Annotated sheets should display only the both annotated and validated ones-->
  198. <act_window id="action_sheet_admin_annotated"
  199. name="Unread notes"
  200. res_model="beesdoo.shift.sheet"
  201. view_mode="tree,form"
  202. domain="[('is_annotated','=',True),
  203. ('is_read','=',False)]"
  204. />
  205. <act_window id="action_sheet_admin_list"
  206. name="All sheets"
  207. res_model="beesdoo.shift.sheet"
  208. view_mode="tree,form"
  209. />
  210. <act_window id="action_sheet_daily"
  211. name="Daily attendance sheets"
  212. res_model="beesdoo.shift.sheet"
  213. view_mode="tree,form"
  214. domain="[('end_time','&gt;', datetime.datetime.now().replace(hour=00, minute=00, second=10)),
  215. ('start_time','&lt;', datetime.datetime.now().replace(hour=23, minute=59, second=59))]"
  216. />
  217. <!-- Top menu item -->
  218. <menuitem id="menu_sheet_top"
  219. name="Attendance Sheets"
  220. parent="beesdoo_shift.menu_root"
  221. groups="beesdoo_shift_attendance.group_shift_attendance_sheet"
  222. sequence="1"
  223. />
  224. <!-- Menu actions -->
  225. <menuitem id="menu_sheet"
  226. name="Daily attendance sheets"
  227. parent="menu_sheet_top"
  228. action="action_sheet_daily"
  229. sequence="2"
  230. />
  231. <menuitem id="menu_sheet_admin_non_validated"
  232. name="Non-validated sheets"
  233. parent="menu_sheet_top"
  234. action="action_sheet_admin_non_validated"
  235. groups="beesdoo_shift.group_shift_attendance"
  236. />
  237. <menuitem id="menu_sheet_admin_annotated"
  238. name="Unread notes"
  239. parent="menu_sheet_top"
  240. action="action_sheet_admin_annotated"
  241. groups="beesdoo_shift.group_shift_attendance"
  242. />
  243. <menuitem id="menu_sheet_admin_list"
  244. name="All sheets"
  245. parent="menu_sheet_top"
  246. action="action_sheet_admin_list"
  247. groups="beesdoo_shift.group_shift_attendance"
  248. />
  249. </odoo>