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.

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