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.

220 lines
9.7 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. <separator string="Added workers" />
  152. <field name="added_shift_ids"/>
  153. <separator string="Expected workers" />
  154. <field name="expected_shift_ids" />
  155. <group string="Informations">
  156. <field name="default_super_coop_id" />
  157. <field name="max_worker_no" />
  158. </group>
  159. <br/>
  160. <group col="1" string="Feedback"
  161. groups="beesdoo_shift.group_cooperative_admin">
  162. <field name="annotation" />
  163. <br/>
  164. <field name="feedback" />
  165. <br/>
  166. <field name="worker_nb_feedback" />
  167. <br/>
  168. <group>
  169. <field name="validated_by" readonly="True"/>
  170. </group>
  171. </group>
  172. </sheet>
  173. <div class="oe_chatter">
  174. <field name="message_ids"
  175. widget="mail_thread"
  176. groups="beesdoo_shift.group_cooperative_admin"
  177. />
  178. </div>
  179. </form>
  180. </field>
  181. </record>
  182. <!-- Actions -->
  183. <!-- This method would be better but library "fields" is not imported -->
  184. <!--
  185. domain="[('end_time','&gt;',fields.Datetime.to_string(datetime.date.today())),
  186. ('start_time','&lt;', fields.Datetime.to_string(datetime.date.today() + datetime.timedelta(days=1)))]" -->
  187. <act_window id="action_sheet_daily"
  188. name="Daily attendance sheets"
  189. res_model="beesdoo.shift.sheet"
  190. view_mode="tree,form"
  191. domain="[('end_time','&gt;', datetime.date.today().strftime('%Y-%m-%d 00:00:00')),
  192. ('start_time','&lt;', datetime.date.today().strftime('%Y-%m-%d 23:59:59'))]"
  193. />
  194. <!-- Top menu item -->
  195. <menuitem id="menu_sheet_top"
  196. name="Attendance Sheets"
  197. parent="menu_root"
  198. groups="beesdoo_shift.group_shift_attendance_sheet"
  199. />
  200. <!-- Menu actions -->
  201. <menuitem id="menu_sheet"
  202. name="Daily attendance sheets"
  203. parent="menu_sheet_top"
  204. action="action_sheet_daily"
  205. sequence="2"
  206. />
  207. </odoo>