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.

148 lines
6.2 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_title">
  74. <h1><field name="name" /></h1>
  75. </div>
  76. <group>
  77. <field name="max_worker_nb" />
  78. </group>
  79. <h2> Expected workers </h2>
  80. <group>
  81. <field name="expected_worker_nb" />
  82. </group>
  83. <field name="expected_shift_ids" />
  84. <h2> Added workers </h2>
  85. <group>
  86. <field name="added_worker_nb" />
  87. </group>
  88. <field name="added_shift_ids" />
  89. <h4> Additional important informations </h4>
  90. <field name="annotation" />
  91. <group>
  92. <field name="is_read"
  93. groups="beesdoo_shift.group_cooperative_admin"
  94. />
  95. </group>
  96. <h4> General feedback </h4>
  97. <field name="feedback" />
  98. <group>
  99. <field name="worker_nb_feedback"/>
  100. </group>
  101. <group>
  102. <field name="validated_by" readonly="True" />
  103. </group>
  104. </sheet>
  105. <div class="oe_chatter">
  106. <field name="message_ids"
  107. widget="mail_thread"
  108. groups="beesdoo_shift.group_cooperative_admin"
  109. />
  110. </div>
  111. </form>
  112. </field>
  113. </record>
  114. <!-- Actions -->
  115. <!-- This method would be better but library "fields" is not imported -->
  116. <!--
  117. domain="[('end_time','&gt;',fields.Datetime.to_string(datetime.date.today())),
  118. ('start_time','&lt;', fields.Datetime.to_string(datetime.date.today() + datetime.timedelta(days=1)))]" -->
  119. <act_window id="action_sheet_daily"
  120. name="Daily attendance sheets"
  121. res_model="beesdoo.shift.sheet"
  122. view_mode="tree,form"
  123. domain="[('end_time','&gt;', datetime.date.today().strftime('%Y-%m-%d 00:00:00')),
  124. ('start_time','&lt;', datetime.date.today().strftime('%Y-%m-%d 23:59:59'))]"
  125. />
  126. <!-- Top menu item -->
  127. <menuitem id="menu_sheet_top"
  128. name="Attendance Sheets"
  129. parent="menu_root"
  130. groups="beesdoo_shift.group_shift_attendance_sheet"
  131. />
  132. <!-- Menu actions -->
  133. <menuitem id="menu_sheet"
  134. name="Daily attendance sheets"
  135. parent="menu_sheet_top"
  136. action="action_sheet_daily"
  137. />
  138. </odoo>