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.

154 lines
6.7 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. <!-- Attendance Sheets Views -->
  41. <record model="ir.ui.view" id="sheet_view_tree">
  42. <field name="name">Attendance Sheet List</field>
  43. <field name="model">beesdoo.shift.sheet</field>
  44. <field name="arch" type="xml">
  45. <!-- <tree create="false" delete="false" decoration-danger="stage == 'absent'"> -->
  46. <tree create="false" decoration-danger="state == 'not_validated'">
  47. <field name="name"/>
  48. <field name="max_worker_nb" type="char"/>
  49. <field name="state" />
  50. <field name="validated_by" />
  51. <field name="is_annotated" />
  52. </tree>
  53. </field>
  54. </record>
  55. <record model="ir.ui.view" id="sheet_view_form">
  56. <field name="name">Attendance Sheet Form</field>
  57. <field name="model">beesdoo.shift.sheet</field>
  58. <field name="arch" type="xml">
  59. <form create="false" delete="false">
  60. <header>
  61. <field name="state" widget="statusbar" readonly="True" />
  62. <button type="object"
  63. name="validate_via_wizard"
  64. string="Validate Sheet"
  65. />
  66. </header>
  67. <sheet>
  68. <div class="oe_button_box" name="button_box">
  69. <button name="button_mark_as_read" type="object"
  70. class="oe_stat_button" icon="fa-check"
  71. string="Mark as read"
  72. groups="beesdoo_shift.group_cooperative_admin"
  73. />
  74. <button name="toggle_active"
  75. type="object"
  76. groups="beesdoo_shift.group_cooperative_admin"
  77. class="oe_stat_button"
  78. icon="fa-archive">
  79. <field name="active" widget="boolean_button" options='{"terminology": "archive"}'/>
  80. </button>
  81. </div>
  82. <div class="oe_title">
  83. <h1><field name="name"/></h1>
  84. </div>
  85. <group>
  86. <field name="max_worker_nb" />
  87. </group>
  88. <h2> Expected workers </h2>
  89. <group>
  90. <field name="expected_worker_nb" />
  91. </group>
  92. <field name="expected_shift_ids"/>
  93. <h2> Added workers </h2>
  94. <group>
  95. <field name="added_worker_nb" />
  96. </group>
  97. <field name="added_shift_ids" />
  98. <h4> Additional important informations </h4>
  99. <field name="annotation" barcode_events="true"/>
  100. <h4> General feedback </h4>
  101. <field name="feedback" />
  102. <field name="worker_nb_feedback" >
  103. <field name="_barcode_scanned" widget="barcode_handler"/>
  104. </field>
  105. <group>
  106. <field name="validated_by" readonly="True" />
  107. </group>
  108. </sheet>
  109. <div class="oe_chatter">
  110. <field name="message_ids"
  111. widget="mail_thread"
  112. groups="beesdoo_shift.group_cooperative_admin"
  113. />
  114. </div>
  115. </form>
  116. </field>
  117. </record>
  118. <!-- Actions -->
  119. <!-- This method would be better but library "fields" is not imported -->
  120. <!--
  121. domain="[('end_time','&gt;',fields.Datetime.to_string(datetime.date.today())),
  122. ('start_time','&lt;', fields.Datetime.to_string(datetime.date.today() + datetime.timedelta(days=1)))]" -->
  123. <act_window id="action_sheet_daily"
  124. name="Daily attendance sheets"
  125. res_model="beesdoo.shift.sheet"
  126. view_mode="tree,form"
  127. domain="[('end_time','&gt;', datetime.date.today().strftime('%Y-%m-%d 00:00:00')),
  128. ('start_time','&lt;', datetime.date.today().strftime('%Y-%m-%d 23:59:59'))]"
  129. />
  130. <!-- Top menu item -->
  131. <menuitem id="menu_sheet_top"
  132. name="Attendance Sheets"
  133. parent="menu_root"
  134. groups="beesdoo_shift.group_shift_attendance_sheet"
  135. />
  136. <!-- Menu actions -->
  137. <menuitem id="menu_sheet"
  138. name="Daily attendance sheets"
  139. parent="menu_sheet_top"
  140. action="action_sheet_daily"
  141. sequence="2"
  142. />
  143. </odoo>