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.

161 lines
8.3 KiB

8 years ago
8 years ago
8 years ago
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <openerp>
  3. <data>
  4. <record model="ir.ui.view" id="dashboard_tile_tile_tree_view">
  5. <field name="model">tile.tile</field>
  6. <field name="arch" type="xml">
  7. <tree string="Dashboard tiles">
  8. <field name="sequence" widget="handle"/>
  9. <field name="name"/>
  10. <field name="domain"/>
  11. <field name="model_id"/>
  12. <field name="primary_function"/>
  13. <field name="primary_field_id"/>
  14. <field name="secondary_function"/>
  15. <field name="secondary_field_id"/>
  16. <field name="user_id"/>
  17. <field name="background_color" widget="color"/>
  18. </tree>
  19. </field>
  20. </record>
  21. <record model="ir.ui.view" id="dashboard_tile_tile_form_view">
  22. <field name="model">tile.tile</field>
  23. <field name="arch" type="xml">
  24. <form string="Dashboard tiles">
  25. <sheet>
  26. <h1>
  27. <field name="name"/>
  28. </h1>
  29. <group col="4">
  30. <separator string="Display" colspan="4"/>
  31. <field name="background_color" widget="color"/>
  32. <field name="font_color" widget="color"/>
  33. <field name="user_id"/>
  34. <separator string="Technical Informations" colspan="4"/>
  35. <field name="model_id"/>
  36. <field name="action_id"/>
  37. <field name="domain" colspan="4"/>
  38. <separator colspan="4"/>
  39. <field name="error" attrs="{'invisible':[('error','=',False)]}"/>
  40. </group>
  41. <notebook>
  42. <page string="Main Value">
  43. <group>
  44. <group>
  45. <field name="primary_function"/>
  46. <field name="primary_field_id" attrs="{
  47. 'invisible':[('primary_function','in',[False,'count'])],
  48. 'required':[('primary_function','not in',[False,'count'])],
  49. }"/>
  50. </group>
  51. <group>
  52. <field name="primary_format"/>
  53. </group>
  54. <group>
  55. <field name="primary_helper"/>
  56. <field name="primary_value" attrs="{'invisible':[('primary_value','=',False)]}"/>
  57. </group>
  58. </group>
  59. </page>
  60. <page string="Secondary Value">
  61. <group>
  62. <group>
  63. <field name="secondary_function"/>
  64. <field name="secondary_field_id" attrs="{
  65. 'invisible':[('secondary_function','in',[False,'count'])],
  66. 'required':[('secondary_function','not in',[False,'count'])],
  67. }"/>
  68. </group>
  69. <group>
  70. <field name="secondary_format"/>
  71. </group>
  72. <group>
  73. <field name="secondary_helper"/>
  74. <field name="secondary_value" attrs="{'invisible':[('secondary_value','=',False)]}"/>
  75. </group>
  76. </group>
  77. </page>
  78. <page string="Groups">
  79. <field name="group_ids"/>
  80. </page>
  81. </notebook>
  82. </sheet>
  83. </form>
  84. </field>
  85. </record>
  86. <!-- CRM Lead Kanban View -->
  87. <record model="ir.ui.view" id="dashboard_tile_tile_kanban_view">
  88. <field name="model">tile.tile</field>
  89. <field name="arch" type="xml">
  90. <kanban edit="false" create="false">
  91. <field name="name"/>
  92. <field name="domain"/>
  93. <field name="model_id"/>
  94. <field name="action_id"/>
  95. <field name="background_color"/>
  96. <field name="font_color"/>
  97. <field name="primary_function"/>
  98. <field name="primary_helper"/>
  99. <field name="secondary_function"/>
  100. <field name="secondary_helper"/>
  101. <templates>
  102. <t t-name="kanban-box">
  103. <div t-attf-class="oe_dashboard_tile oe_kanban_global_click" t-attf-style="background-color:#{record.background_color.raw_value}" >
  104. <div class="oe_kanban_content">
  105. <a type="object" name="open_link" args="[]" t-attf-style="color:#{record.font_color.raw_value};">
  106. <div style="height:100%;" t-att-class="record.secondary_function.raw_value and 'with_secondary' or 'simple'">
  107. <div class="tile_label">
  108. <field name="name"/>
  109. </div>
  110. <div class="tile_primary_value" t-att-title="record.primary_helper.raw_value">
  111. <t t-set="l" t-value="record.primary_value.raw_value.length" />
  112. <t t-set="s" t-value="l>=12 and 35 or l>=10 and 45 or l>=8 and 55 or l>=6 and 75 or l>4 and 85 or 100"/>
  113. <span t-attf-style="font-size: #{s}%;"><field name="primary_value"/></span>
  114. </div>
  115. <div class="tile_secondary_value" t-att-title="record.secondary_helper.raw_value">
  116. <span><field name="secondary_value"/></span>
  117. </div>
  118. </div>
  119. </a>
  120. </div>
  121. <div class="oe_clear"></div>
  122. </div>
  123. </t>
  124. </templates>
  125. </kanban>
  126. </field>
  127. </record>
  128. <record model="ir.actions.act_window" id="action_tree_dashboard_tile">
  129. <field name="name">Dashboard</field>
  130. <field name="res_model">tile.tile</field>
  131. <field name="view_type">form</field>
  132. <field name="view_mode">tree,kanban,form</field>
  133. <field name="view_id" ref="dashboard_tile_tile_tree_view"/>
  134. </record>
  135. <menuitem id="menue_dashboard_tile"
  136. name="Dashboard Tile" parent="base.next_id_2"
  137. action="action_tree_dashboard_tile" sequence="50"/>
  138. <record model="ir.actions.act_window" id="action_kanban_dashboard_tile">
  139. <field name="name">Dashboard</field>
  140. <field name="res_model">tile.tile</field>
  141. <field name="view_type">form</field>
  142. <field name="view_mode">kanban</field>
  143. <field name="domain">['|',('user_id','=',False),('user_id','=',uid)]</field>
  144. <field name="view_id" ref="dashboard_tile_tile_tree_view"/>
  145. </record>
  146. <record id="mail_dashboard" model="ir.ui.menu">
  147. <field name="name">Dashboard</field>
  148. <field name="sequence" eval="0"/>
  149. <field name="action" ref="action_kanban_dashboard_tile"/>
  150. <field name="parent_id" ref=""/>
  151. </record>
  152. </data>
  153. </openerp>