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.

195 lines
8.6 KiB

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