mirror of
https://github.com/OCA/reporting-engine.git
synced 2025-02-16 16:30:38 +02:00
[MIG] bi_sql_editor : from 15.0 to 16.0
- move menu and action in according view file - use new sql_request_abstract menu entry for SQL views configuration - Use sql_request_abstract primary tree view - Use sql_request_abstract primary form view - move has_grouped_changed in sql_request_abstract module - improve demo data - add default count value to display in pivot, if no pivot_measures are defined ; - set widget handle to sequence field - reorder fields in tree view and add optional hide for some fields - simplify : make field_description field required - improve : add optional='hide' and 'show' on tree visibility - replace obsolete base.menu_board_root by spreadsheet_dashboard entries - update translation
This commit is contained in:
committed by
OCA-git-bot
parent
d62f47fd19
commit
6be6f7d02f
@@ -1,14 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!--
|
||||
Copyright (C) 2017 - Today: GRAP (http://www.grap.coop)
|
||||
@author Sylvain LE GAL (https://twitter.com/legalsylvain)
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
-->
|
||||
<odoo>
|
||||
<record id="action_bi_sql_view" model="ir.actions.act_window">
|
||||
<field name="name">SQL Views</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">bi.sql.view</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -1,22 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!--
|
||||
Copyright (C) 2017 - Today: GRAP (http://www.grap.coop)
|
||||
@author Sylvain LE GAL (https://twitter.com/legalsylvain)
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
-->
|
||||
<odoo>
|
||||
<!-- Menu that will contain all the SQL report generated by this module -->
|
||||
<menuitem
|
||||
id="menu_bi_sql_editor"
|
||||
name="SQL Reports"
|
||||
parent="base.menu_board_root"
|
||||
groups="sql_request_abstract.group_sql_request_user"
|
||||
sequence="0"
|
||||
/>
|
||||
<menuitem
|
||||
id="menu_bi_sql_view"
|
||||
parent="base.next_id_9"
|
||||
groups="sql_request_abstract.group_sql_request_manager"
|
||||
action="action_bi_sql_view"
|
||||
/>
|
||||
</odoo>
|
||||
@@ -5,215 +5,201 @@ Copyright (C) 2017 - Today: GRAP (http://www.grap.coop)
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
-->
|
||||
<odoo>
|
||||
|
||||
<record id="view_bi_sql_view_tree" model="ir.ui.view">
|
||||
<field name="model">bi.sql.view</field>
|
||||
<field
|
||||
name="inherit_id"
|
||||
ref="sql_request_abstract.view_sql_request_mixin_tree"
|
||||
/>
|
||||
<field name="mode">primary</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree
|
||||
decoration-info="state=='draft'"
|
||||
decoration-warning="state in ('sql_valid', 'model_valid')"
|
||||
>
|
||||
<field name="name" position="before">
|
||||
<field name="sequence" widget="handle" />
|
||||
<field name="name" />
|
||||
</field>
|
||||
<field name="name" position="after">
|
||||
<field name="technical_name" />
|
||||
<field name="size" />
|
||||
<field name="state" />
|
||||
</tree>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_bi_sql_view_form" model="ir.ui.view">
|
||||
<field name="model">bi.sql.view</field>
|
||||
<field
|
||||
name="inherit_id"
|
||||
ref="sql_request_abstract.view_sql_request_mixin_form"
|
||||
/>
|
||||
<field name="mode">primary</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<header>
|
||||
<button
|
||||
name="button_validate_sql_expression"
|
||||
type="object"
|
||||
states="draft"
|
||||
string="Validate SQL Expression"
|
||||
class="oe_highlight"
|
||||
<xpath expr="//header" position="inside">
|
||||
<button
|
||||
name="button_set_draft"
|
||||
type="object"
|
||||
states="model_valid,ui_valid"
|
||||
string="Set to Draft"
|
||||
groups="sql_request_abstract.group_sql_request_manager"
|
||||
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"
|
||||
/>
|
||||
|
||||
<button
|
||||
name="button_create_sql_view_and_model"
|
||||
type="object"
|
||||
states="sql_valid"
|
||||
string="Create SQL Elements"
|
||||
class="oe_highlight"
|
||||
help="This will try to create an SQL View, based on the SQL request and the according Transient Model and fields, based on settings"
|
||||
/>
|
||||
<button
|
||||
name="button_update_model_access"
|
||||
type="object"
|
||||
string="Update Model Access"
|
||||
class="oe_highlight"
|
||||
attrs="{'invisible': ['|', ('state', 'in', ('draft', 'sql_valid')), ('has_group_changed', '=', False)]}"
|
||||
help="Update Model Access. Required if you changed groups list after having created the model"
|
||||
/>
|
||||
<button
|
||||
name="button_create_ui"
|
||||
type="object"
|
||||
states="model_valid"
|
||||
string="Create UI"
|
||||
class="oe_highlight"
|
||||
help="This will create Odoo View, Action and Menu"
|
||||
/>
|
||||
<button
|
||||
name="button_refresh_materialized_view"
|
||||
type="object"
|
||||
string="Refresh"
|
||||
help="Refresh Materialized View"
|
||||
attrs="{'invisible': ['|', ('state', 'in', ('draft', 'sql_valid')), ('is_materialized', '=', False)]}"
|
||||
/>
|
||||
<button
|
||||
name="button_open_view"
|
||||
type="object"
|
||||
string="Open View"
|
||||
states="ui_valid"
|
||||
class="oe_highlight"
|
||||
/>
|
||||
</xpath>
|
||||
<group name="group_main_info" position="inside">
|
||||
<group>
|
||||
<field
|
||||
name="technical_name"
|
||||
attrs="{'readonly': [('state', '!=', 'draft')]}"
|
||||
/>
|
||||
<button
|
||||
name="button_set_draft"
|
||||
type="object"
|
||||
states="sql_valid"
|
||||
string="Set to Draft"
|
||||
groups="sql_request_abstract.group_sql_request_manager"
|
||||
<field name="view_name" />
|
||||
<field name="view_order" />
|
||||
<field name="is_materialized" />
|
||||
<field
|
||||
name="size"
|
||||
attrs="{'invisible': ['|', ('state', '=', 'draft'), ('is_materialized', '=', False)]}"
|
||||
/>
|
||||
<button
|
||||
name="button_set_draft"
|
||||
type="object"
|
||||
states="model_valid,ui_valid"
|
||||
string="Set to Draft"
|
||||
groups="sql_request_abstract.group_sql_request_manager"
|
||||
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"
|
||||
/>
|
||||
<button
|
||||
name="button_preview_sql_expression"
|
||||
type="object"
|
||||
states="draft"
|
||||
string="Preview SQL Expression"
|
||||
/>
|
||||
<button
|
||||
name="button_create_sql_view_and_model"
|
||||
type="object"
|
||||
states="sql_valid"
|
||||
string="Create SQL View, Indexes and Models"
|
||||
class="oe_highlight"
|
||||
help="This will try to create an SQL View, based on the SQL request and the according Transient Model and fields, based on settings"
|
||||
/>
|
||||
<button
|
||||
name="button_update_model_access"
|
||||
type="object"
|
||||
attrs="{'invisible': ['|', ('state', 'in', ('draft', 'sql_valid')), ('has_group_changed', '=', False)]}"
|
||||
string="Update Model Access"
|
||||
class="oe_highlight"
|
||||
help="Update Model Access. Required if you changed groups list after having created the model"
|
||||
/>
|
||||
<button
|
||||
name="button_create_ui"
|
||||
type="object"
|
||||
states="model_valid"
|
||||
string="Create UI"
|
||||
class="oe_highlight"
|
||||
help="This will create Odoo View, Action and Menu"
|
||||
/>
|
||||
<button
|
||||
name="button_refresh_materialized_view"
|
||||
type="object"
|
||||
string="Refresh Materialized View"
|
||||
<field
|
||||
name="cron_id"
|
||||
attrs="{'invisible': ['|', ('state', 'in', ('draft', 'sql_valid')), ('is_materialized', '=', False)]}"
|
||||
help="this will refresh the materialized view"
|
||||
/>
|
||||
<button
|
||||
name="button_open_view"
|
||||
type="object"
|
||||
string="Open View"
|
||||
states="ui_valid"
|
||||
class="oe_highlight"
|
||||
/>
|
||||
<field name="state" widget="statusbar" />
|
||||
</header>
|
||||
<sheet>
|
||||
<h1>
|
||||
<field
|
||||
name="name"
|
||||
attrs="{'readonly': [('state','!=','draft')]}"
|
||||
colspan="4"
|
||||
/>
|
||||
</h1>
|
||||
<group>
|
||||
<group>
|
||||
<group>
|
||||
<field
|
||||
name="technical_name"
|
||||
attrs="{'readonly': [('state', '!=', 'draft')]}"
|
||||
/>
|
||||
<field name="view_name" />
|
||||
<field name="view_order" />
|
||||
<field name="is_materialized" />
|
||||
<field
|
||||
name="size"
|
||||
attrs="{'invisible': ['|', ('state', '=', 'draft'), ('is_materialized', '=', False)]}"
|
||||
/>
|
||||
<field
|
||||
name="cron_id"
|
||||
attrs="{'invisible': ['|', ('state', 'in', ('draft', 'sql_valid')), ('is_materialized', '=', False)]}"
|
||||
/>
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="SQL Query">
|
||||
<field
|
||||
name="query"
|
||||
nolabel="1"
|
||||
colspan="4"
|
||||
attrs="{'readonly': [('state', '!=', 'draft')]}"
|
||||
widget="ace"
|
||||
/>
|
||||
</page>
|
||||
<page
|
||||
string="SQL Fields"
|
||||
attrs="{'invisible': [('state', '=', 'draft')]}"
|
||||
</group>
|
||||
</group>
|
||||
<page name="page_sql" position="after">
|
||||
<page
|
||||
string="SQL Fields"
|
||||
attrs="{'invisible': [('state', '=', 'draft')]}"
|
||||
>
|
||||
<field
|
||||
name="bi_sql_view_field_ids"
|
||||
nolabel="1"
|
||||
colspan="4"
|
||||
attrs="{'readonly': [('state', '!=', 'sql_valid')]}"
|
||||
>
|
||||
<tree
|
||||
editable="bottom"
|
||||
decoration-info="field_description==False"
|
||||
>
|
||||
<field name="sequence" widget="handle" />
|
||||
<field name="name" />
|
||||
<field name="sql_type" />
|
||||
<field name="field_description" />
|
||||
<field name="ttype" />
|
||||
<field
|
||||
name="bi_sql_view_field_ids"
|
||||
nolabel="1"
|
||||
colspan="4"
|
||||
attrs="{'readonly': [('state', '!=', 'sql_valid')]}"
|
||||
>
|
||||
<tree
|
||||
editable="bottom"
|
||||
decoration-info="field_description==False"
|
||||
>
|
||||
<field name="sequence" />
|
||||
<field name="name" />
|
||||
<field name="sql_type" />
|
||||
<field name="field_description" />
|
||||
<field
|
||||
name='group_operator'
|
||||
attrs="{
|
||||
'invisible': ['!', ('ttype', 'in', ('float', 'integer'))]}"
|
||||
/>
|
||||
<field
|
||||
name="ttype"
|
||||
attrs="{
|
||||
'required': [('field_description', '!=', False)]}"
|
||||
/>
|
||||
<field
|
||||
name="many2one_model_id"
|
||||
attrs="{
|
||||
'invisible': [('ttype', '!=', 'many2one')],
|
||||
'required': [
|
||||
('field_description', '!=', False),
|
||||
('ttype', '=', 'many2one')]}"
|
||||
/>
|
||||
<field
|
||||
name="selection"
|
||||
attrs="{
|
||||
'invisible': [('ttype', '!=', 'selection')],
|
||||
'required': [
|
||||
('field_description', '!=', False),
|
||||
('ttype', '=', 'selection')]}"
|
||||
/>
|
||||
<field
|
||||
name="is_index"
|
||||
attrs="{'invisible': [('field_description', '=', False)]}"
|
||||
/>
|
||||
<field
|
||||
name="is_group_by"
|
||||
attrs="{'invisible': [('field_description', '=', False)]}"
|
||||
/>
|
||||
<field
|
||||
name="graph_type"
|
||||
attrs="{'invisible': [('field_description', '=', False)]}"
|
||||
/>
|
||||
<field
|
||||
name="tree_visibility"
|
||||
attrs="{'invisible': [('field_description', '=', False)]}"
|
||||
/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
<page string="Security">
|
||||
<group string="Rule Definition">
|
||||
<field name="domain_force" nolabel="1" colspan="4" />
|
||||
</group>
|
||||
<group string="Allowed Groups">
|
||||
<field name="group_ids" nolabel="1" colspan="4" />
|
||||
<field name="has_group_changed" invisible="1" />
|
||||
</group>
|
||||
</page>
|
||||
name="many2one_model_id"
|
||||
attrs="{
|
||||
'invisible': [('ttype', '!=', 'many2one')],
|
||||
'required': [('ttype', '=', 'many2one')],
|
||||
}"
|
||||
/>
|
||||
<field
|
||||
name="selection"
|
||||
attrs="{
|
||||
'invisible': [('ttype', '!=', 'selection')],
|
||||
'required': [
|
||||
('field_description', '!=', False),
|
||||
('ttype', '=', 'selection')]}"
|
||||
/>
|
||||
<field
|
||||
name='group_operator'
|
||||
optional="hide"
|
||||
attrs="{
|
||||
'invisible': [('ttype', 'not in', ('float', 'integer'))]}"
|
||||
/>
|
||||
<field
|
||||
name="is_index"
|
||||
optional="hide"
|
||||
attrs="{'invisible': [('field_description', '=', False)]}"
|
||||
/>
|
||||
<field
|
||||
name="graph_type"
|
||||
attrs="{'invisible': [('field_description', '=', False)]}"
|
||||
/>
|
||||
<field
|
||||
name="is_group_by"
|
||||
optional="hide"
|
||||
attrs="{'invisible': [('field_description', '=', False)]}"
|
||||
/>
|
||||
<field
|
||||
name="tree_visibility"
|
||||
optional="hide"
|
||||
attrs="{'invisible': [('field_description', '=', False)]}"
|
||||
/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
</page>
|
||||
<page name="page_security" position="inside">
|
||||
<group string="Rule Definition">
|
||||
<field
|
||||
name="domain_force"
|
||||
nolabel="1"
|
||||
colspan="2"
|
||||
widget="ace"
|
||||
options="{'mode': 'python'}"
|
||||
/>
|
||||
</group>
|
||||
</page>
|
||||
<!-- user_ids are not used for the time being in bi_sql_editor module -->
|
||||
<group name="group_allowed_users" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</group>
|
||||
<field name="user_ids" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</field>
|
||||
|
||||
<page name="page_security" position="after">
|
||||
<page string="Action Settings">
|
||||
<group string="Computed Context">
|
||||
<field
|
||||
name="computed_action_context"
|
||||
nolabel="1"
|
||||
colspan="4"
|
||||
/>
|
||||
name="computed_action_context"
|
||||
nolabel="1"
|
||||
colspan="2"
|
||||
/>
|
||||
</group>
|
||||
<group string="Custom Context">
|
||||
<field name="action_context" nolabel="1" colspan="4" />
|
||||
<field
|
||||
name="action_context"
|
||||
nolabel="1"
|
||||
colspan="2"
|
||||
widget="ace"
|
||||
options="{'mode': 'python'}"
|
||||
/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Extras Information">
|
||||
@@ -221,9 +207,9 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
<group string="Model">
|
||||
<field name="model_name" />
|
||||
<field
|
||||
name="model_id"
|
||||
attrs="{'invisible': [('state', '=', 'draft')]}"
|
||||
/>
|
||||
name="model_id"
|
||||
attrs="{'invisible': [('state', '=', 'draft')]}"
|
||||
/>
|
||||
</group>
|
||||
<group string="User Interface">
|
||||
<field name="tree_view_id" />
|
||||
@@ -235,9 +221,32 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
</form>
|
||||
|
||||
</page>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_bi_sql_view" model="ir.actions.act_window">
|
||||
<field name="name">SQL Views</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">bi.sql.view</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
|
||||
<menuitem
|
||||
id="menu_bi_sql_view"
|
||||
parent="spreadsheet_dashboard.spreadsheet_dashboard_menu_configuration"
|
||||
groups="sql_request_abstract.group_sql_request_manager"
|
||||
action="action_bi_sql_view"
|
||||
/>
|
||||
|
||||
<!-- Menu that will contain all the SQL report generated by this module -->
|
||||
<menuitem
|
||||
id="menu_bi_sql_editor"
|
||||
name="SQL Reports"
|
||||
parent="spreadsheet_dashboard.spreadsheet_dashboard_menu_root"
|
||||
groups="sql_request_abstract.group_sql_request_user"
|
||||
sequence="5"
|
||||
/>
|
||||
|
||||
</odoo>
|
||||
|
||||
Reference in New Issue
Block a user