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.

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