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.

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