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.

133 lines
6.4 KiB

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <record id="sql_export_view_form" model="ir.ui.view">
  4. <field name="name">Sql_export_form_view</field>
  5. <field name="model">sql.export</field>
  6. <field name="arch" type="xml">
  7. <form string="SQL export">
  8. <header>
  9. <button name="button_validate_sql_expression" type="object" states="draft"
  10. string="Validate SQL Expression" class="oe_highlight"/>
  11. <button name="button_preview_sql_expression" type="object" states="draft" string="Preview Results" attrs="{'invisible': [('field_ids', '!=', False)]}"/>
  12. <button name="button_set_draft" type="object" states="sql_valid"
  13. string="Set to Draft" groups="sql_request_abstract.group_sql_request_manager"/>
  14. <button name="export_sql_query" string="Execute Query" states="sql_valid" type="object" class="oe_highlight"
  15. icon="fa-arrow-right text-success"/>
  16. <field name="state" widget="statusbar"/>
  17. </header>
  18. <sheet>
  19. <group>
  20. <h1>
  21. <field name="name" nolabel="1" placeholder="Request Name"/>
  22. </h1>
  23. </group>
  24. <group name="option" groups="sql_request_abstract.group_sql_request_user">
  25. <field name="file_format"/>
  26. <field name="copy_options" attrs="{'invisible': [('file_format', '!=', 'csv')], 'required': [('file_format', '=', 'csv')]}"/>
  27. <field name="encoding"/>
  28. </group>
  29. <group name="request" string="SQL Request" groups="sql_request_abstract.group_sql_request_user">
  30. <field name="query" nolabel="1" placeholder="select * from res_partner"/>
  31. </group>
  32. <group name="parameters" string="Parameters" groups="sql_request_abstract.group_sql_request_user">
  33. <field name="field_ids" nolabel="1"/>
  34. </group>
  35. <group groups="sql_request_abstract.group_sql_request_manager">
  36. <group string="Allowed Users" name="users_allowed">
  37. <field name="user_ids" nolabel="1"/>
  38. </group>
  39. <group string="Allowed Groups" name="groups_allowed">
  40. <field name="group_ids" nolabel="1"/>
  41. </group>
  42. </group>
  43. </sheet>
  44. </form>
  45. </field>
  46. </record>
  47. <record id="sql_export_view_tree" model="ir.ui.view">
  48. <field name="name">Sql_export_tree_view</field>
  49. <field name="model">sql.export</field>
  50. <field name="arch" type="xml">
  51. <tree string="SQL Export" colors="blue:state == 'draft'">
  52. <field name="name"/>
  53. <field name="state"/>
  54. <button name="export_sql_query" string="Execute Query" states="sql_valid" type="object"
  55. icon="fa-arrow-right text-success"/>
  56. </tree>
  57. </field>
  58. </record>
  59. <record id="sql_export_tree_action" model="ir.actions.act_window">
  60. <field name="name">SQL Export</field>
  61. <field name="res_model">sql.export</field>
  62. <field name="view_type">form</field>
  63. <field name="view_mode">tree,form</field>
  64. </record>
  65. <menuitem id="sql_export_menu" name="Sql Export"
  66. parent="base.menu_reporting_dashboard" sequence="80"/>
  67. <menuitem id="sql_export_menu_view" name="Sql Export" parent="sql_export_menu" action="sql_export_tree_action" sequence="1"/>
  68. <record id="sql_parameter_view_form" model="ir.ui.view">
  69. <field name="name">Sql_parameter_form_view</field>
  70. <field name="model">ir.model.fields</field>
  71. <field name="priority">150</field>
  72. <field name="arch" type="xml">
  73. <form string="SQL export">
  74. <group>
  75. <field name="name"/>
  76. <field name="field_description"/>
  77. <field name="ttype"/>
  78. <field name="relation" attrs="{'invisible': [('ttype', 'not in', ('many2one', 'many2many', 'one2many'))], 'required': [('ttype', 'in', ('many2one', 'many2many', 'one2many'))]}"/>
  79. <field name="model_id" readonly="1"/>
  80. <field name="model" invisible="1"/>
  81. <field name="required"/>
  82. </group>
  83. </form>
  84. </field>
  85. </record>
  86. <record id="sql_parameter_view_tree" model="ir.ui.view">
  87. <field name="name">Sql_parameter_tree_view</field>
  88. <field name="model">ir.model.fields</field>
  89. <field name="priority">150</field>
  90. <field name="arch" type="xml">
  91. <tree string="SQL Parameter">
  92. <field name="name"/>
  93. <field name="field_description"/>
  94. <field name="ttype"/>
  95. <field name="required"/>
  96. </tree>
  97. </field>
  98. </record>
  99. <record id="sql_parameter_action" model="ir.actions.act_window">
  100. <field name="name">SQL Parameter</field>
  101. <field name="res_model">ir.model.fields</field>
  102. <field name="view_type">form</field>
  103. <field name="view_mode">tree,form</field>
  104. <field name="context" eval="{'default_model_id': ref('sql_export.model_sql_file_wizard'), 'default_size': 64, 'search_default_state': 'manual', 'default_model': 'sql.file.wizard'}"/>
  105. <field name="domain">[('model','=','sql.file.wizard')]</field>
  106. </record>
  107. <record id="sql_parameter_action_view_tree" model="ir.actions.act_window.view">
  108. <field name="sequence" eval="1"/>
  109. <field name="view_mode">tree</field>
  110. <field name="view_id" ref="sql_parameter_view_tree"/>
  111. <field name="act_window_id" ref="sql_parameter_action"/>
  112. </record>
  113. <record id="sql_parameter_action_view_form" model="ir.actions.act_window.view">
  114. <field name="sequence" eval="2"/>
  115. <field name="view_mode">form</field>
  116. <field name="view_id" ref="sql_parameter_view_form"/>
  117. <field name="act_window_id" ref="sql_parameter_action"/>
  118. </record>
  119. <menuitem id="sql_parameter_menu_view" name="Sql Export Variables" parent="sql_export_menu" action="sql_parameter_action" sequence="5" groups="sql_request_abstract.group_sql_request_manager"/>
  120. </odoo>