hr_employee_views.xml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <record id="hr_employee_view_search" model="ir.ui.view">
  4. <field name="name">hr.employee.view.search</field>
  5. <field name="model">hr.employee</field>
  6. <field name="inherit_id" ref="hr.view_employee_filter"/>
  7. <field name="arch" type="xml">
  8. <filter name="group_manager" position="after">
  9. <filter name="group_hr_presence_state" string="Presence" domain="[]" context="{'group_by':'hr_presence_state_display'}" groups="hr.group_hr_manager"/>
  10. </filter>
  11. </field>
  12. </record>
  13. <record id="hr_employee_view_presence_search" model="ir.ui.view">
  14. <field name="name">hr.employee.view.search.presence</field>
  15. <field name="model">hr.employee</field>
  16. <field name="arch" type="xml">
  17. <search string="Employees">
  18. <filter name="group_hr_presence_state" string="Presence" domain="[]" context="{'group_by':'hr_presence_state_display'}"/>
  19. <searchpanel>
  20. <field name="company_id" groups="base.group_multi_company" icon="fa-building"/>
  21. <field name="hr_presence_state_display" string="Absence/Presence" />
  22. <field name="department_id" icon="fa-users"/>
  23. </searchpanel>
  24. </search>
  25. </field>
  26. </record>
  27. <record id="hr_employee_view_kanban" model="ir.ui.view">
  28. <field name="name">hr.employee.view.kanban</field>
  29. <field name="model">hr.employee</field>
  30. <field name="inherit_id" ref="hr.hr_kanban_view_employees"/>
  31. <field name="groups_id" eval="[(4, ref('hr.group_hr_manager'))]"/>
  32. <field name="mode">primary</field>
  33. <field name="arch" type="xml">
  34. <xpath expr="//kanban" position="attributes">
  35. <attribute name="create">0</attribute>
  36. </xpath>
  37. <xpath expr="//div[hasclass('oe_kanban_details')]" position="inside">
  38. <div class="oe_kanban_content">
  39. <div class="oe_kanban_row">
  40. <field name="hr_presence_state" invisible="1"/>
  41. <button name="action_set_present" type="object" class="btn btn-primary btn-sm mt8 fa fa-check" title="Set as present" attrs="{'invisible': [('hr_presence_state', '=', 'present')]}"> </button>
  42. <button name="action_set_absent" type="object" class="btn btn-primary btn-sm mt8 fa fa-times" title="Set as absent" attrs="{'invisible': [('hr_presence_state', '!=', 'present')]}"> </button>
  43. <button name="action_open_leave_request" type="object" class="btn btn-primary btn-sm mt8">Time Off</button>
  44. </div>
  45. <div class="oe_kanban_row">
  46. <button name="action_send_sms" type="object" class="btn btn-primary btn-sm mt8">SMS</button>
  47. <button name="action_send_mail" type="object" class="btn btn-primary btn-sm mt8">Log</button>
  48. </div>
  49. </div>
  50. </xpath>
  51. </field>
  52. </record>
  53. </odoo>