hr_efficiency_views.xml 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <data>
  4. <!-- Tree View -->
  5. <record id="view_hr_efficiency_tree" model="ir.ui.view">
  6. <field name="name">hr.efficiency.tree</field>
  7. <field name="model">hr.efficiency</field>
  8. <field name="arch" type="xml">
  9. <list string="Employee Efficiency" decoration-success="overall_efficiency >= 90" decoration-warning="overall_efficiency >= 70 and overall_efficiency &lt; 90" decoration-danger="overall_efficiency &lt; 70">
  10. <field name="month_year"/>
  11. <field name="employee_id"/>
  12. <field name="company_id" groups="base.group_multi_company"/>
  13. <field name="calculation_date"/>
  14. <field name="available_hours" sum="Total Available"/>
  15. <field name="planned_hours" sum="Total Planned"/>
  16. <field name="planned_billable_hours" sum="Total Planned Billable"/>
  17. <field name="planned_non_billable_hours" sum="Total Planned Non-Billable"/>
  18. <field name="actual_billable_hours" sum="Total Actual Billable"/>
  19. <field name="actual_non_billable_hours" sum="Total Actual Non-Billable"/>
  20. <field name="total_actual_hours" sum="Total Actual"/>
  21. <field name="overall_efficiency"/>
  22. </list>
  23. </field>
  24. </record>
  25. <!-- Form View -->
  26. <record id="view_hr_efficiency_form" model="ir.ui.view">
  27. <field name="name">hr.efficiency.form</field>
  28. <field name="model">hr.efficiency</field>
  29. <field name="arch" type="xml">
  30. <form string="Employee Efficiency">
  31. <sheet>
  32. <div class="oe_title">
  33. <h1>
  34. <field name="display_name" readonly="1"/>
  35. </h1>
  36. </div>
  37. <group>
  38. <group>
  39. <field name="month_year"/>
  40. <field name="employee_id"/>
  41. <field name="company_id" groups="base.group_multi_company"/>
  42. <field name="calculation_date"/>
  43. </group>
  44. <group>
  45. <!-- Dynamic indicator fields will be added here -->
  46. <field name="overall_efficiency"/>
  47. </group>
  48. </group>
  49. <notebook>
  50. <page string="Available Hours" name="available">
  51. <group>
  52. <field name="available_hours" widget="float_time"/>
  53. </group>
  54. </page>
  55. <page string="Planned Hours" name="planned">
  56. <group>
  57. <field name="planned_hours" widget="float_time"/>
  58. <field name="planned_billable_hours" widget="float_time"/>
  59. <field name="planned_non_billable_hours" widget="float_time"/>
  60. </group>
  61. </page>
  62. <page string="Actual Hours" name="actual">
  63. <group>
  64. <field name="actual_billable_hours" widget="float_time"/>
  65. <field name="actual_non_billable_hours" widget="float_time"/>
  66. <field name="total_actual_hours" widget="float_time"/>
  67. </group>
  68. </page>
  69. </notebook>
  70. </sheet>
  71. </form>
  72. </field>
  73. </record>
  74. <!-- Search View -->
  75. <record id="view_hr_efficiency_search" model="ir.ui.view">
  76. <field name="name">hr.efficiency.search</field>
  77. <field name="model">hr.efficiency</field>
  78. <field name="arch" type="xml">
  79. <search string="Search Efficiency">
  80. <field name="employee_id"/>
  81. <field name="month_year"/>
  82. <field name="company_id" groups="base.group_multi_company"/>
  83. <!-- Filtros de indicadores -->
  84. <filter string="High Overall Efficiency" name="high_overall_efficiency" domain="[('overall_efficiency', '>=', 90)]"/>
  85. <!-- Filtros de tipo de proyecto -->
  86. <separator/>
  87. <filter string="Proyectos Facturables" name="billable_projects" domain="[('planned_billable_hours', '>', 0)]"/>
  88. <filter string="Proyectos No Facturables" name="non_billable_projects" domain="[('planned_non_billable_hours', '>', 0)]"/>
  89. <!-- Filtros de fecha -->
  90. <separator/>
  91. <filter string="junio" name="june_2025" domain="[('month_year', '=', '2025-06')]"/>
  92. <filter string="julio" name="july_2025" domain="[('month_year', '=', '2025-07')]"/>
  93. <filter string="agosto" name="august_2025" domain="[('month_year', '=', '2025-08')]"/>
  94. <filter string="septiembre" name="september_2025" domain="[('month_year', '=', '2025-09')]"/>
  95. <filter string="octubre" name="october_2025" domain="[('month_year', '=', '2025-10')]"/>
  96. <!-- Filtros de trimestres -->
  97. <separator/>
  98. <filter string="Trimestre 1" name="q1_2025" domain="[('month_year', 'in', ['2025-01', '2025-02', '2025-03'])]"/>
  99. <filter string="Trimestre 2" name="q2_2025" domain="[('month_year', 'in', ['2025-04', '2025-05', '2025-06'])]"/>
  100. <filter string="Trimestre 3" name="q3_2025" domain="[('month_year', 'in', ['2025-07', '2025-08', '2025-09'])]"/>
  101. <filter string="Trimestre 4" name="q4_2025" domain="[('month_year', 'in', ['2025-10', '2025-11', '2025-12'])]"/>
  102. <!-- Filtros de años -->
  103. <separator/>
  104. <filter string="2023" name="year_2023" domain="[('month_year', 'like', '2023-')]"/>
  105. <filter string="2024" name="year_2024" domain="[('month_year', 'like', '2024-')]"/>
  106. <filter string="2025" name="year_2025" domain="[('month_year', 'like', '2025-')]"/>
  107. <!-- Filtro de archivado -->
  108. <separator/>
  109. <filter string="Archivado" name="archived" domain="[('active', '=', False)]"/>
  110. <filter string="No Archivado" name="not_archived" domain="[('active', '=', True)]"/>
  111. <group expand="0" string="Group By">
  112. <filter string="Employee" name="group_employee" context="{'group_by': 'employee_id'}"/>
  113. <filter string="Month" name="group_month" context="{'group_by': 'month_year'}"/>
  114. <filter string="Company" name="group_company" context="{'group_by': 'company_id'}" groups="base.group_multi_company"/>
  115. </group>
  116. </search>
  117. </field>
  118. </record>
  119. <!-- Action -->
  120. <record id="action_hr_efficiency" model="ir.actions.act_window">
  121. <field name="name">Employee Efficiency</field>
  122. <field name="res_model">hr.efficiency</field>
  123. <field name="view_mode">list,form</field>
  124. <field name="search_view_id" ref="view_hr_efficiency_search"/>
  125. <field name="context">{'search_default_august_2025': 1}</field>
  126. <field name="help" type="html">
  127. <p class="o_view_nocontent_empty_folder">
  128. No efficiency records found!
  129. </p><p>
  130. Create efficiency records by running the calculation wizard or wait for the automatic weekly calculation.
  131. </p>
  132. </field>
  133. </record>
  134. <!-- Menu -->
  135. <menuitem id="menu_hr_efficiency"
  136. name="Efficiency"
  137. parent="hr.menu_hr_root"
  138. action="action_hr_efficiency"
  139. sequence="50"
  140. groups="hr.group_hr_user"/>
  141. </data>
  142. </odoo>