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.

237 lines
12 KiB

  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!--
  3. Copyright (C) 2017 - Today: GRAP (http://www.grap.coop)
  4. @author Sylvain LE GAL (https://twitter.com/legalsylvain)
  5. License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  6. -->
  7. <odoo>
  8. <record id="view_bi_sql_view_tree" model="ir.ui.view">
  9. <field name="model">bi.sql.view</field>
  10. <field name="arch" type="xml">
  11. <tree
  12. decoration-info="state=='draft'"
  13. decoration-warning="state in ('sql_valid', 'model_valid')"
  14. >
  15. <field name="sequence" widget="handle" />
  16. <field name="name" />
  17. <field name="technical_name" />
  18. <field name="size" />
  19. <field name="state" />
  20. </tree>
  21. </field>
  22. </record>
  23. <record id="view_bi_sql_view_form" model="ir.ui.view">
  24. <field name="model">bi.sql.view</field>
  25. <field name="arch" type="xml">
  26. <form>
  27. <header>
  28. <button
  29. name="button_validate_sql_expression"
  30. type="object"
  31. states="draft"
  32. string="Validate SQL Expression"
  33. class="oe_highlight"
  34. />
  35. <button
  36. name="button_set_draft"
  37. type="object"
  38. states="sql_valid"
  39. string="Set to Draft"
  40. groups="sql_request_abstract.group_sql_request_manager"
  41. />
  42. <button
  43. name="button_set_draft"
  44. type="object"
  45. states="model_valid,ui_valid"
  46. string="Set to Draft"
  47. groups="sql_request_abstract.group_sql_request_manager"
  48. confirm="Are you sure you want to set to draft this SQL View. It will delete the materialized view, and all the previous mapping realized with the columns"
  49. />
  50. <button
  51. name="button_preview_sql_expression"
  52. type="object"
  53. states="draft"
  54. string="Preview SQL Expression"
  55. />
  56. <button
  57. name="button_create_sql_view_and_model"
  58. type="object"
  59. states="sql_valid"
  60. string="Create SQL View, Indexes and Models"
  61. class="oe_highlight"
  62. help="This will try to create an SQL View, based on the SQL request and the according Transient Model and fields, based on settings"
  63. />
  64. <button
  65. name="button_update_model_access"
  66. type="object"
  67. attrs="{'invisible': ['|', ('state', 'in', ('draft', 'sql_valid')), ('has_group_changed', '=', False)]}"
  68. string="Update Model Access"
  69. class="oe_highlight"
  70. help="Update Model Access. Required if you changed groups list after having created the model"
  71. />
  72. <button
  73. name="button_create_ui"
  74. type="object"
  75. states="model_valid"
  76. string="Create UI"
  77. class="oe_highlight"
  78. help="This will create Odoo View, Action and Menu"
  79. />
  80. <button
  81. name="button_refresh_materialized_view"
  82. type="object"
  83. string="Refresh Materialized View"
  84. attrs="{'invisible': ['|', ('state', 'in', ('draft', 'sql_valid')), ('is_materialized', '=', False)]}"
  85. help="this will refresh the materialized view"
  86. />
  87. <button
  88. name="button_open_view"
  89. type="object"
  90. string="Open View"
  91. states="ui_valid"
  92. class="oe_highlight"
  93. />
  94. <field name="state" widget="statusbar" />
  95. </header>
  96. <sheet>
  97. <h1>
  98. <field
  99. name="name"
  100. attrs="{'readonly': [('state','!=','draft')]}"
  101. colspan="4"
  102. />
  103. </h1>
  104. <group>
  105. <group>
  106. <group>
  107. <field
  108. name="technical_name"
  109. attrs="{'readonly': [('state', '!=', 'draft')]}"
  110. />
  111. <field name="view_name" />
  112. <field name="view_order" />
  113. <field name="is_materialized" />
  114. <field
  115. name="size"
  116. attrs="{'invisible': ['|', ('state', '=', 'draft'), ('is_materialized', '=', False)]}"
  117. />
  118. <field
  119. name="cron_id"
  120. attrs="{'invisible': ['|', ('state', 'in', ('draft', 'sql_valid')), ('is_materialized', '=', False)]}"
  121. />
  122. </group>
  123. </group>
  124. </group>
  125. <notebook>
  126. <page string="SQL Query">
  127. <field
  128. name="query"
  129. nolabel="1"
  130. colspan="4"
  131. attrs="{'readonly': [('state', '!=', 'draft')]}"
  132. />
  133. </page>
  134. <page
  135. string="SQL Fields"
  136. attrs="{'invisible': [('state', '=', 'draft')]}"
  137. >
  138. <field
  139. name="bi_sql_view_field_ids"
  140. nolabel="1"
  141. colspan="4"
  142. attrs="{'readonly': [('state', '!=', 'sql_valid')]}"
  143. >
  144. <tree
  145. editable="bottom"
  146. decoration-info="field_description==False"
  147. >
  148. <field name="sequence" />
  149. <field name="name" />
  150. <field name="sql_type" />
  151. <field name="field_description" />
  152. <field
  153. name="ttype"
  154. attrs="{
  155. 'required': [('field_description', '!=', False)]}"
  156. />
  157. <field
  158. name="many2one_model_id"
  159. attrs="{
  160. 'invisible': [('ttype', '!=', 'many2one')],
  161. 'required': [
  162. ('field_description', '!=', False),
  163. ('ttype', '=', 'many2one')]}"
  164. />
  165. <field
  166. name="selection"
  167. attrs="{
  168. 'invisible': [('ttype', '!=', 'selection')],
  169. 'required': [
  170. ('field_description', '!=', False),
  171. ('ttype', '=', 'selection')]}"
  172. />
  173. <field
  174. name="is_index"
  175. attrs="{'invisible': [('field_description', '=', False)]}"
  176. />
  177. <field
  178. name="is_group_by"
  179. attrs="{'invisible': [('field_description', '=', False)]}"
  180. />
  181. <field
  182. name="graph_type"
  183. attrs="{'invisible': [('field_description', '=', False)]}"
  184. />
  185. <field
  186. name="tree_visibility"
  187. attrs="{'invisible': [('field_description', '=', False)]}"
  188. />
  189. </tree>
  190. </field>
  191. </page>
  192. <page string="Security">
  193. <group string="Rule Definition">
  194. <field name="domain_force" nolabel="1" colspan="4" />
  195. </group>
  196. <group string="Allowed Groups">
  197. <field name="group_ids" nolabel="1" colspan="4" />
  198. <field name="has_group_changed" invisible="1" />
  199. </group>
  200. </page>
  201. <page string="Action Settings">
  202. <group string="Computed Context">
  203. <field
  204. name="computed_action_context"
  205. nolabel="1"
  206. colspan="4"
  207. />
  208. </group>
  209. <group string="Custom Context">
  210. <field name="action_context" nolabel="1" colspan="4" />
  211. </group>
  212. </page>
  213. <page string="Extras Information">
  214. <group>
  215. <group string="Model">
  216. <field name="model_name" />
  217. <field
  218. name="model_id"
  219. attrs="{'invisible': [('state', '=', 'draft')]}"
  220. />
  221. </group>
  222. <group string="User Interface">
  223. <field name="tree_view_id" />
  224. <field name="graph_view_id" />
  225. <field name="pivot_view_id" />
  226. <field name="search_view_id" />
  227. <field name="action_id" />
  228. <field name="menu_id" />
  229. </group>
  230. </group>
  231. </page>
  232. </notebook>
  233. </sheet>
  234. </form>
  235. </field>
  236. </record>
  237. </odoo>