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.

104 lines
4.9 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="arch" type="xml">
  71. <form string="SQL export">
  72. </form>
  73. </field>
  74. </record>
  75. <record id="sql_parameter_view_tree" model="ir.ui.view">
  76. <field name="name">Sql_parameter_tree_view</field>
  77. <field name="model">ir.model.fields</field>
  78. <field name="arch" type="xml">
  79. <tree string="SQL Parameter">
  80. <field name="name"/>
  81. </tree>
  82. </field>
  83. </record>
  84. <record id="sql_parameter_tree_action" model="ir.actions.act_window">
  85. <field name="name">SQL Parameter</field>
  86. <field name="res_model">ir.model.fields</field>
  87. <field name="view_type">form</field>
  88. <field name="view_mode">tree,form</field>
  89. <field name="context" eval="{'default_model_id': ref('sql_export.model_sql_file_wizard'), 'default_size': 64, 'search_default_state': 'manual'}"/>
  90. <field name="domain">[('model','=','sql.file.wizard')]</field>
  91. </record>
  92. <menuitem id="sql_parameter_menu_view" name="Sql Export Variables" parent="sql_export_menu" action="sql_parameter_tree_action" sequence="5" groups="sql_request_abstract.group_sql_request_manager"/>
  93. </odoo>