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.

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