car_dashboard.xml 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <openerp>
  2. <data>
  3. <record id="car_car_form" model="ir.ui.view">
  4. <field name="name">car.car.form</field>
  5. <field name="model">car.car</field>
  6. <field name="arch" type="xml">
  7. <form string="Vehicle">
  8. <header>
  9. <field name="state" widget="statusbar" clickable="True"/>
  10. </header>
  11. <sheet string="Vehiculo">
  12. <div class="oe_right oe_button_box" name="buttons" groups="base.group_user">
  13. <button class="oe_stat_button"
  14. icon="fa-tasks"
  15. name="%(fleet_car_workshop.worksheet_action_super_button)d"
  16. type="action">
  17. <field string="Tareas" name="task_count" widget="statinfo" />
  18. </button>
  19. </div>
  20. <div>
  21. <field name="image_medium" widget='image' class="oe_avatar"/>
  22. </div>
  23. <div class="oe_title">
  24. <h1>
  25. <field name="name" placeholder="Vehiculo"/>
  26. </h1>
  27. <div>
  28. <field name="use_tasks" class="oe_inline"/>
  29. <label for="use_tasks" class="oe_inline" string="Usar tareas"/>
  30. <span attrs="{'invisible':[('use_tasks', '=', False)]}">como </span>
  31. <field name="label_tasks" class="oe_inline oe_input_align" attrs="{'invisible': [('use_tasks', '=', False)]}"/>
  32. </div>
  33. </div>
  34. <notebook>
  35. <page string="Configuración">
  36. <group>
  37. <field name="partner_id" string="Cliente" domain="[('customer', '=', True)]"/>
  38. </group>
  39. </page>
  40. </notebook>
  41. </sheet>
  42. </form>
  43. </field>
  44. </record>
  45. <record id="view_car_car_filter" model="ir.ui.view">
  46. <field name="name">car.car.select</field>
  47. <field name="model">car.car</field>
  48. <field name="arch" type="xml">
  49. <search string="Search Vehicle">
  50. <field name="name" string="Nombre del vehiculo"/>
  51. <filter string="Abierto" name="Current" domain="[('state', '=','open')]"/>
  52. <filter string="Pendiente" name="Pending" domain="[('state', '=','pending')]"/>
  53. <separator/>
  54. <separator/>
  55. <group expand="0" string="Agrupar por ">
  56. <filter string="Cliente" name="Partner" context="{'group_by':'partner_id'}"/>
  57. </group>
  58. </search>
  59. </field>
  60. </record>
  61. <record model="ir.ui.view" id="view_car_car_kanban">
  62. <field name="name">car.car.kanban</field>
  63. <field name="model">car.car</field>
  64. <field name="arch" type="xml">
  65. <kanban class="oe_background_grey">
  66. <field name="name"/>
  67. <field name="use_tasks"/>
  68. <field name="color"/>
  69. <field name="task_count"/>
  70. <field name="label_tasks"/>
  71. <field name="task_ids"/>
  72. <field name="doc_count"/>
  73. <templates>
  74. <t t-name="kanban-box">
  75. <div t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_card oe_kanban_project oe_kanban_global_click">
  76. <div class="oe_dropdown_toggle oe_dropdown_kanban" groups="base.group_user">
  77. <span class="oe_e">í</span>
  78. <ul class="oe_dropdown_menu">
  79. <t t-if="widget.view.is_action_enabled('edit')"><li><a type="edit">Configurar</a></li></t>
  80. <li><ul class="oe_kanban_colorpicker" data-field="color"/></li>
  81. </ul>
  82. </div>
  83. <div class="oe_kanban_content">
  84. <h4 class="text-center"><strong><field name="name"/></strong></h4>
  85. <div class="o_kanban_image text-center">
  86. <img t-att-src="kanban_image('car.car', 'image_medium', record.id.value)"/>
  87. </div>
  88. <div class="oe_kanban_project_list">
  89. <div t-if="record.use_tasks.raw_value" class="o_project_kanban_box">
  90. <a name="%(fleet_car_workshop.worksheet_action_super_button)d" type="action" style="margin-right: 10px">
  91. <t t-raw="record.task_count.raw_value"/><t t-raw="record.label_tasks.raw_value" />
  92. </a>
  93. </div>
  94. </div>
  95. <div class="oe_kanban_project_list">
  96. <a t-if="record.doc_count.raw_value" name="attachment_tree_views" type="object" style="margin-right: 10px"> <field name="doc_count"/> Documents</a>
  97. </div>
  98. </div>
  99. </div>
  100. </t>
  101. </templates>
  102. </kanban>
  103. </field>
  104. </record>
  105. <record id="view_car_car_tree" model="ir.ui.view">
  106. <field name="name">car.car.tree</field>
  107. <field name="model">car.car</field>
  108. <field name="field_parent">child_ids</field>
  109. <field name="arch" type="xml">
  110. <tree decoration-info="state in ('draft','pending')" decoration-muted="state in ('close','cancelled')" string="Vehicles">
  111. <field name="name" string="Nombre del vehiculo"/>
  112. <field name="partner_id" string="Cliente"/>
  113. <field name="state" string="Estado"/>
  114. </tree>
  115. </field>
  116. </record>
  117. <record id="open_view_vehicle_all" model="ir.actions.act_window">
  118. <field name="name">Vehiculos</field>
  119. <field name="res_model">car.car</field>
  120. <field name="view_type">form</field>
  121. <field name="domain">[]</field>
  122. <field name="view_mode">kanban,form</field>
  123. <field name="search_view_id" ref="view_car_car_filter"/>
  124. <field name="context">{'search_default_Current': 1}</field>
  125. </record>
  126. <record id="config_view_vehicle_all" model="ir.actions.act_window">
  127. <field name="name">Vehiculos</field>
  128. <field name="res_model">car.car</field>
  129. <field name="view_type">form</field>
  130. <field name="domain">[]</field>
  131. <field name="view_mode">tree,form</field>
  132. <field name="search_view_id" ref="view_car_car_filter"/>
  133. <field name="context">{'search_default_Current': 1}</field>
  134. </record>
  135. <menuitem name="Panel de Control" parent="main_workshop_menu" id="workshop_vehicles" sequence="1"/>
  136. <menuitem name="Todos los Vehiculos" parent="workshop_vehicles" id="workshop_all_vehicles" sequence="1" action="open_view_vehicle_all"/>
  137. <menuitem name="Vehiculos" action="config_view_vehicle_all" id="config_vehicle_view_action" parent="menu_worksheet_config" />
  138. </data>
  139. </openerp>