OCA reporting engine fork for dev and update.
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.

171 lines
7.7 KiB

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!-- Copyright 2020 Creu Blanca
  3. License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
  4. <odoo>
  5. <record model="ir.actions.act_window" id="kpi_kpi_history_act_window">
  6. <field name="name">Kpi History</field>
  7. <field name="res_model">kpi.kpi.history</field>
  8. <field name="view_mode">tree</field>
  9. <field name="domain">[('kpi_id', '=', active_id)]</field>
  10. <field name="context">{}</field>
  11. </record>
  12. <record model="ir.ui.view" id="kpi_kpi_history_widget_form_view">
  13. <field name="name">kpi.kpi.history.raw.form (in kpi_dashboard)</field>
  14. <field name="model">kpi.kpi.history</field>
  15. <field name="arch" type="xml">
  16. <form>
  17. <field name="create_date" invisible="1"/>
  18. <field name="widget" invisible="1"/>
  19. <field name="name" invisible="1"/>
  20. <field name="value"
  21. widget="kpi"
  22. options="{'date': 'create_date', 'widget': 'widget', 'name': 'name'}"/>
  23. </form>
  24. </field>
  25. </record>
  26. <record model="ir.ui.view" id="kpi_kpi_history_raw_form_view">
  27. <field name="name">kpi.kpi.history.raw.form (in kpi_dashboard)</field>
  28. <field name="model">kpi.kpi.history</field>
  29. <field name="arch" type="xml">
  30. <form>
  31. <field name="raw_value"/>
  32. </form>
  33. </field>
  34. </record>
  35. <record model="ir.ui.view" id="kpi_kpi_history_tree_view">
  36. <field name="name">kpi.kpi.history.tree (in kpi_dashboard)</field>
  37. <field name="model">kpi.kpi.history</field>
  38. <field name="arch" type="xml">
  39. <tree create="0" delete="0">
  40. <field name="create_date"/>
  41. <button name="show_form" string="Show value" type="object"
  42. context="{'form_id': %(kpi_dashboard.kpi_kpi_history_widget_form_view)d}"
  43. />
  44. <button name="show_form" string="Raw value" type="object"
  45. context="{'form_id': %(kpi_dashboard.kpi_kpi_history_raw_form_view)d}"
  46. />
  47. </tree>
  48. </field>
  49. </record>
  50. <record model="ir.ui.view" id="kpi_kpi_form_view">
  51. <field name="name">kpi.kpi.form (in kpi_dashboard)</field>
  52. <field name="model">kpi.kpi</field>
  53. <field name="arch" type="xml">
  54. <form>
  55. <header>
  56. <button name="generate_cron" string="Generate cron" type="object"
  57. attrs="{'invisible': ['|', ('cron_id', '!=',False), ('compute_on_fly', '=', True)]}"/>
  58. <button name="compute" string="Compute now" type="object" attrs="{'invisible': [('compute_on_fly', '=', True)]}"/>
  59. </header>
  60. <sheet>
  61. <div class="oe_button_box" name="button_box">
  62. <button name="%(kpi_dashboard.kpi_kpi_history_act_window)d"
  63. string="Show history"
  64. type="action"
  65. attrs="{'invisible': ['|', ('store_history', '=', False), ('compute_on_fly', '=', True)]}"
  66. icon="fa-history"/>
  67. <button string="Show value" type="object" name="show_value"
  68. icon="fa-paint-brush"
  69. />
  70. </div>
  71. <h2>
  72. <field name="name"/>
  73. </h2>
  74. <group>
  75. <group>
  76. <field name="computation_method"/>
  77. <field name="widget"/>
  78. <field name="store_history" attrs="{'invisible': [('compute_on_fly', '=', True)]}"/>
  79. <field name="store_history_interval" attrs="{'invisible': [('store_history', '=', False)]}"/>
  80. <field name="store_history_interval_number" attrs="{'invisible': [('store_history', '=', False)]}"/>
  81. <field name="compute_on_fly" attrs="{'invisible': [('store_history', '=', True)]}"/>
  82. <field name="model_id" attrs="{'invisible': [('computation_method', '!=', 'function')]}"/>
  83. <field name="function" attrs="{'required': [('computation_method', '=', 'function')], 'invisible': [('computation_method', '!=', 'function')]}"/>
  84. <field name="args" attrs="{'invisible': [('computation_method', '!=', 'function')]}"/>
  85. <field name="kwargs" attrs="{'invisible': [('computation_method', '!=', 'function')]}"/>
  86. </group>
  87. <group>
  88. <field name="cron_id" attrs="{'invisible': [('cron_id', '=',False)]}" readonly="True"/>
  89. </group>
  90. <group>
  91. <field name="suffix"/>
  92. <field name="prefix"/>
  93. </group>
  94. </group>
  95. <notebook>
  96. <page name="action" string="Actions">
  97. <field name="action_ids">
  98. <tree editable="bottom">
  99. <field name="action"/>
  100. </tree>
  101. </field>
  102. </page>
  103. <page name="code" string="Code" attrs="{'invisible': [('computation_method', '!=', 'code')]}">
  104. <field name="code" widget="ace"
  105. options="{'mode': 'python'}"
  106. placeholder="Enter Python code here."/>
  107. </page>
  108. </notebook>
  109. </sheet>
  110. </form>
  111. </field>
  112. </record>
  113. <record model="ir.ui.view" id="kpi_kpi_widget_form_view">
  114. <field name="name">kpi.kpi.raw.form (in kpi_dashboard)</field>
  115. <field name="model">kpi.kpi</field>
  116. <field name="arch" type="xml">
  117. <form>
  118. <field name="computed_date" invisible="1"/>
  119. <field name="widget" invisible="1"/>
  120. <field name="name" invisible="1"/>
  121. <field name="computed_value"
  122. widget="kpi"
  123. options="{'date': 'computed_date', 'widget': 'widget', 'name': 'name'}"/>
  124. </form>
  125. </field>
  126. </record>
  127. <record model="ir.ui.view" id="kpi_kpi_search_view">
  128. <field name="name">kpi.kpi.search (in kpi_dashboard)</field>
  129. <field name="model">kpi.kpi</field>
  130. <field name="arch" type="xml">
  131. <search>
  132. <field name="name"/>
  133. </search>
  134. </field>
  135. </record>
  136. <record model="ir.ui.view" id="kpi_kpi_tree_view">
  137. <field name="name">kpi.kpi.tree (in kpi_dashboard)</field>
  138. <field name="model">kpi.kpi</field>
  139. <field name="arch" type="xml">
  140. <tree>
  141. <field name="name"/>
  142. </tree>
  143. </field>
  144. </record>
  145. <record model="ir.actions.act_window" id="kpi_kpi_act_window">
  146. <field name="name">Kpi</field>
  147. <field name="res_model">kpi.kpi</field>
  148. <field name="view_mode">tree,form</field>
  149. <field name="domain">[]</field>
  150. <field name="context">{}</field>
  151. </record>
  152. <record model="ir.ui.menu" id="kpi_kpi_menu">
  153. <field name="name">Configure Kpi</field>
  154. <field name="parent_id" ref="menu_configuration_kpi_dashboards"/>
  155. <field name="action" ref="kpi_kpi_act_window"/>
  156. <field name="sequence" eval="20"/>
  157. </record>
  158. </odoo>