fleet_vehicle_views.xml 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <record id="fleet_vehicle_odometer_view_tree" model="ir.ui.view">
  4. <field name="name">fleet.vehicle.odometer.view.tree.inherit.hr.fleet</field>
  5. <field name="model">fleet.vehicle.odometer</field>
  6. <field name="inherit_id" ref="fleet.fleet_vehicle_odometer_view_tree" />
  7. <field name="arch" type="xml">
  8. <xpath expr="//field[@name='driver_id']" position="after">
  9. <field name="driver_employee_id" widget="many2one_avatar" optional="hide"/>
  10. </xpath>
  11. </field>
  12. </record>
  13. <!-- main view for fleet-->
  14. <record id="fleet_vehicle_assignation_log_view_list" model="ir.ui.view">
  15. <field name="name">fleet.vehicle.assignation.log.view.tree.inherit.hr.fleet</field>
  16. <field name="model">fleet.vehicle.assignation.log</field>
  17. <field name="mode">primary</field>
  18. <field name="inherit_id" ref="fleet.fleet_vehicle_assignation_log_view_list" />
  19. <field name="arch" type="xml">
  20. <field name="vehicle_id" position="attributes">
  21. <attribute name="optional">hide</attribute>
  22. </field>
  23. <field name="driver_id" position="after">
  24. <field name="driver_employee_id" widget="many2one_avatar"/>
  25. </field>
  26. <field name="date_end" position="after">
  27. <field name="attachment_number" optional="show" />
  28. <button name="action_get_attachment_view" string="Attachments" type="object" icon="fa-paperclip"/>
  29. </field>
  30. </field>
  31. </record>
  32. <!-- for employee cars -->
  33. <record id="fleet_vehicle_assignation_log_employee_view_list" model="ir.ui.view">
  34. <field name="name">fleet.vehicle.assignation.log.view.tree.inherit.hr.fleet</field>
  35. <field name="model">fleet.vehicle.assignation.log</field>
  36. <field name="mode">primary</field>
  37. <field name="inherit_id" ref="fleet.fleet_vehicle_assignation_log_view_list" />
  38. <field name="arch" type="xml">
  39. <field name="driver_id" position="replace" />
  40. <field name="date_end" position="after">
  41. <field name="driver_id" string="Current Driver" optional="hide"/>
  42. <field name="attachment_number" optional="show" />
  43. <button name="action_get_attachment_view" string="Attachments" type="object" icon="fa-paperclip" />
  44. </field>
  45. </field>
  46. </record>
  47. <record id="fleet_vehicle_view_form_inherit_hr" model="ir.ui.view">
  48. <field name="name">fleet.vehicle.form.inherit.hr</field>
  49. <field name="model">fleet.vehicle</field>
  50. <field name="inherit_id" ref="fleet.fleet_vehicle_view_form"/>
  51. <field name="arch" type="xml">
  52. <xpath expr="//field[@name='driver_id']" position="after">
  53. <field name="driver_employee_id" invisible="1"/>
  54. <field name="mobility_card" readonly="1"/>
  55. </xpath>
  56. <xpath expr="//field[@name='future_driver_id']" position="after">
  57. <field name="future_driver_employee_id" invisible="1"/>
  58. </xpath>
  59. <button name="open_assignation_logs" position="before">
  60. <button name="action_open_employee" type="object" class="oe_stat_button" icon="fa-id-card-o" groups="hr.group_hr_user" attrs="{'invisible': [('driver_employee_id', '=', False)]}">
  61. <div class="o_field_widget o_stat_info">
  62. <span class="o_stat_value">1</span>
  63. <span class="o_stat_text">Employee</span>
  64. </div>
  65. </button>
  66. </button>
  67. </field>
  68. </record>
  69. <record id="fleet_vehicle_view_search_inherit_hr" model="ir.ui.view">
  70. <field name="name">fleet.vehicle.search.inherit.hr</field>
  71. <field name="model">fleet.vehicle</field>
  72. <field name="inherit_id" ref="fleet.fleet_vehicle_view_search"/>
  73. <field name="arch" type="xml">
  74. <xpath expr="//field[@name='license_plate']" position="after">
  75. <field name="mobility_card"/>
  76. </xpath>
  77. <xpath expr="//field[@name='driver_id']" position="after">
  78. <field name="driver_employee_id" string="Current Driver (Employee)"/>
  79. </xpath>
  80. <xpath expr="//field[@name='log_drivers']" position="attributes">
  81. <attribute name="filter_domain">[
  82. '|', '|', '|', '|',
  83. ('log_drivers.driver_id.name', 'ilike', self),
  84. ('driver_id.name', 'ilike', self),
  85. ('future_driver_id.name', 'ilike', self),
  86. ('driver_employee_id.name', 'ilike', self),
  87. ('future_driver_employee_id.name', 'ilike', self),
  88. ]</attribute>
  89. </xpath>
  90. </field>
  91. </record>
  92. <record id="fleet_vehicle_view_tree_inherit_hr" model="ir.ui.view">
  93. <field name="model">fleet.vehicle</field>
  94. <field name="inherit_id" ref="fleet.fleet_vehicle_view_tree"/>
  95. <field name="arch" type="xml">
  96. <field name="driver_id" position="after">
  97. <field name="driver_employee_id" optional="hide"/>
  98. </field>
  99. <field name="future_driver_id" position="after">
  100. <field name="future_driver_employee_id" optional="hide"/>
  101. </field>
  102. </field>
  103. </record>
  104. <record id="view_attachment_kanban_inherit_hr" model="ir.ui.view">
  105. <field name="name">ir.attachment.kanban.inherit.hr</field>
  106. <field name="model">ir.attachment</field>
  107. <field name="inherit_id" ref="mail.view_document_file_kanban"/>
  108. <field name="mode">primary</field>
  109. <field name="arch" type="xml">
  110. <xpath expr="//kanban" position="attributes">
  111. <attribute name="js_class">hr_fleet_kanban_view</attribute>
  112. </xpath>
  113. </field>
  114. </record>
  115. </odoo>