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.

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