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.

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