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.

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