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.

225 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="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="state" options="{'no_open': True}" />
  41. <field name="compensation_no"
  42. options="{'horizontal': true}"
  43. attrs="{
  44. 'invisible': [('state', 'in', ['done', False])]
  45. }"
  46. />
  47. </tree>
  48. </field>
  49. </record>
  50. <record model="ir.ui.view" id="sheet_added_view_tree">
  51. <field name="view_mode">tree</field>
  52. <field name="name">Added Shifts List</field>
  53. <field name="model">beesdoo.shift.sheet.added</field>
  54. <field name="arch" type="xml">
  55. <tree editable="bottom"
  56. decoration-success="stage == 'present'">
  57. <field name="task_type_id"
  58. options="{'no_open': True, 'no_create': True, 'no_create_edit':True }" />
  59. <field name="worker_id"
  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="stage" readonly="True" />
  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" options="{'no_open': True}" />
  77. <field name="worker_id" options="{'no_open': True}" />
  78. <field name="working_mode" options="{'no_open': True}" />
  79. <field name="replacement_worker_id" options="{'no_open': True}" />
  80. <field name="stage" options="{'no_open': True}" />
  81. </group>
  82. </form>
  83. </field>
  84. </record>
  85. <record model="ir.ui.view" id="sheet_added_view_form">
  86. <field name="view_mode">tree</field>
  87. <field name="name">Added Shifts Form</field>
  88. <field name="model">beesdoo.shift.sheet.added</field>
  89. <field name="arch" type="xml">
  90. <form readonly="True" >
  91. <group>
  92. <field name="task_type_id" options="{'no_open': True}" />
  93. <field name="worker_id" options="{'no_open': True}" />
  94. <field name="working_mode" options="{'no_open': True}" />
  95. <field name="is_compensation" options="{'no_open': True}"
  96. attrs="{'readonly':
  97. [('working_mode','=','irregular')]}"
  98. />
  99. <field name="state" options="{'no_open': True}" />
  100. </group>
  101. </form>
  102. </field>
  103. </record>
  104. <!-- Attendance Sheets Views -->
  105. <record model="ir.ui.view" id="sheet_view_tree">
  106. <field name="name">Attendance Sheet List</field>
  107. <field name="model">beesdoo.shift.sheet</field>
  108. <field name="arch" type="xml">
  109. <tree create="false" delete="false" decoration-danger="state == 'not_validated'">
  110. <field name="week" />
  111. <field name="day" />
  112. <field name="time_slot" />
  113. <field name="max_worker_no" type="char"/>
  114. <field name="state" />
  115. <field name="validated_by" />
  116. <field name="is_annotated" />
  117. </tree>
  118. </field>
  119. </record>
  120. <record model="ir.ui.view" id="sheet_view_form">
  121. <field name="name">Attendance Sheet Form</field>
  122. <field name="model">beesdoo.shift.sheet</field>
  123. <field name="arch" type="xml">
  124. <form create="false" delete="false">
  125. <field name="_barcode_scanned" widget="barcode_handler"/>
  126. <header>
  127. <div>
  128. <field name="state" widget="statusbar" readonly="True" class="oe_inline"/>
  129. <button type="object"
  130. name="validate_via_wizard"
  131. string="Validate Sheet"
  132. attrs="{'invisible': [('state', '=', 'validated')]}"
  133. />
  134. </div>
  135. <div class="oe_clear" />
  136. </header>
  137. <sheet>
  138. <div class="oe_button_box" name="button_box">
  139. <button name="button_mark_as_read" type="object"
  140. class="oe_stat_button" icon="fa-check"
  141. string="Mark as read"
  142. groups="beesdoo_shift.group_cooperative_admin"
  143. />
  144. <button name="toggle_active"
  145. type="object"
  146. groups="beesdoo_shift.group_cooperative_admin"
  147. class="oe_stat_button"
  148. icon="fa-archive">
  149. <field name="active" widget="boolean_button" options='{"terminology": "archive"}'/>
  150. </button>
  151. </div>
  152. <div class="oe_title">
  153. <h1>
  154. <field name="time_slot" />
  155. </h1>
  156. </div>
  157. <group>
  158. <field name="max_worker_no" />
  159. </group>
  160. <separator string="Added workers" />
  161. <field name="added_shift_ids"/>
  162. <separator string="Expected workers" />
  163. <field name="expected_shift_ids" />
  164. <br/>
  165. <group col="1" string="Feedback"
  166. groups="beesdoo_shift.group_cooperative_admin">
  167. <field name="annotation" />
  168. <br/>
  169. <field name="feedback" />
  170. <br/>
  171. <field name="worker_nb_feedback" />
  172. <br/>
  173. <group>
  174. <field name="validated_by" readonly="True"/>
  175. </group>
  176. </group>
  177. </sheet>
  178. <div class="oe_chatter">
  179. <field name="message_ids"
  180. widget="mail_thread"
  181. groups="beesdoo_shift.group_cooperative_admin"
  182. />
  183. </div>
  184. </form>
  185. </field>
  186. </record>
  187. <!-- Actions -->
  188. <!-- This method would be better but library "fields" is not imported -->
  189. <!--
  190. domain="[('end_time','&gt;',fields.Datetime.to_string(datetime.date.today())),
  191. ('start_time','&lt;', fields.Datetime.to_string(datetime.date.today() + datetime.timedelta(days=1)))]" -->
  192. <act_window id="action_sheet_daily"
  193. name="Daily attendance sheets"
  194. res_model="beesdoo.shift.sheet"
  195. view_mode="tree,form"
  196. domain="[('end_time','&gt;', datetime.date.today().strftime('%Y-%m-%d 00:00:00')),
  197. ('start_time','&lt;', datetime.date.today().strftime('%Y-%m-%d 23:59:59'))]"
  198. />
  199. <!-- Top menu item -->
  200. <menuitem id="menu_sheet_top"
  201. name="Attendance Sheets"
  202. parent="menu_root"
  203. groups="beesdoo_shift.group_shift_attendance_sheet"
  204. />
  205. <!-- Menu actions -->
  206. <menuitem id="menu_sheet"
  207. name="Daily attendance sheets"
  208. parent="menu_sheet_top"
  209. action="action_sheet_daily"
  210. sequence="2"
  211. />
  212. </odoo>