TIP: You can type at any time to perform a new search.
BI SQL Editor
bi_sql_editor · OCA/reporting-engine
- Repository
- OCA/reporting-engine · module folder · Try on Runboat
- Module version
- 2.0.1
- Category
- Reporting
- Folder size
- 2.01 MB
- License
- AGPL-3
- Application
- No
- Auto-installable
- No
- Website
- https://github.com/OCA/reporting-engine
- Last tracking update
- 2026-08-07 09:06:34
- Authors
- Odoo Community Association (OCA), GRAP
- Maintainers
- Odoo Community Association (OCA), GRAP
- Committers
- Jesús Alan Ramos Rodríguez, Baptiste Pellarin, Weblate, Franco Leyes, OCA-git-bot, oca-ci
- Odoo dependencies
- Python dependencies
- None
- System dependencies
- None
- Required by
- None
- Description
This module extends the functionality of reporting, to support creation of extra custom reports. It allows user to write a custom SQL request. (Generally, admin users) Once written, a new model is generated, and user can map the selected field with odoo fields. Then user ends the process, creating new menu, action and graph view. Technically, the module create SQL View (or materialized view, if option is checked). Materialized view duplicates datas, but request are fastest. If materialized view is enabled, this module will create a cron task to refresh the data). By default, users member of 'SQL Request / User' can see all the views. You can specify extra groups that have the right to access to a specific view. ## Warning This module is intended for technician people in a company and for Odoo integrators. It requires the user to know SQL syntax and Odoo models. If you don't have such skills, do not try to use this module specially on a production environment. ## Use Cases this module is interesting for the following use cases - You want to realize technical SQL requests, that Odoo framework doesn't allow (For exemple, UNION with many SELECT) A typical use case is if you want to have Sale Orders and PoS Orders datas in a same table - You want to customize an Odoo report, removing some useless fields and adding some custom ones. In that case, you can simply select the fields of the original report (sale.report model for exemple), and add your custom fields - You have a lot of data, and classical SQL Views have very bad performance. In that case, MATERIALIZED VIEW will be a good solution to reduce display duration
Code Analysis ⓘ
Views touched (2)
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
view_bi_sql_view_form |
bi.sql.view | form | Inherits sql_request_abstract.view_sql_request_mixin_form | |
view_bi_sql_view_tree |
bi.sql.view | tree | Inherits sql_request_abstract.view_sql_request_mixin_tree |
HTTP endpoints (0)
No HTTP endpoints found for this module.
Models touched (3)
New fields (25)
-
action_contextTextdefault='{}'help='Define here a context that will be used by default, when creating the action.' -
action_idMany2one → ir.actions.act_windowcomodel_name='ir.actions.act_window'string='Odoo Action' -
bi_sql_view_field_idsOne2many → bi.sql.view.fieldcomodel_name='bi.sql.view.field'inverse_name='bi_sql_view_id'string='SQL Fields' -
computed_action_contextTextcompute='_compute_computed_action_context' -
cron_idMany2one → ir.croncomodel_name='ir.cron'copy=Falsehelp='Cron Task that will refresh the materialized view'ondelete='cascade'string='Odoo Cron' -
domain_forceTextdefault='[]'help="Define here access restriction to data.\n Take care to use field name prefixed by 'x_'. A global 'ir.rule' will be created. A typical Multi Company rule is for exemple \n ['|', ('x_company_id','child_of', [user.company_id.id]),('x_company_id','=',False)]."string='Extra Rule Definition' -
form_view_idMany2one → ir.ui.viewcomodel_name='ir.ui.view'string='Odoo Form View' -
graph_view_idMany2one → ir.ui.viewcomodel_name='ir.ui.view'string='Odoo Graph View' -
is_materializedBooleandefault=Truestring='Is Materialized View' -
materialized_textCharcompute='_compute_materialized_text'store=True -
menu_idMany2one → ir.ui.menucomodel_name='ir.ui.menu'string='Odoo Menu' -
model_idMany2one → ir.modelcomodel_name='ir.model'string='Odoo Model' -
model_nameCharcompute='_compute_model_name'help='Full Qualified Name of the transient model that will be created.'store=True -
parent_menu_idMany2one → ir.ui.menucomodel_name='ir.ui.menu'default=<expr>help="By assigning a value to this field before manually creating the UI, you're overwriting the parent menu on which the menu related to the SQL report will be created."required=Truestring='Parent Odoo Menu' -
pivot_view_idMany2one → ir.ui.viewcomodel_name='ir.ui.view'string='Odoo Pivot View' -
queryTextdefault='SELECT\n my_field as x_my_field\nFROM my_table'help="SQL Request that will be inserted as the view. Take care to :\n * set a name for all your selected fields, specially if you use SQL function (like EXTRACT, ...);\n * Do not use 'SELECT *' or 'SELECT table.*';\n * prefix the name of the selectable columns by 'x_';" -
rule_idMany2one → ir.rulecomodel_name='ir.rule'string='Odoo Rule' -
search_view_idMany2one → ir.ui.viewcomodel_name='ir.ui.view'string='Odoo Search View' -
sequenceIntegerstring='sequence' -
sizeCharhelp='Size of the materialized view and its indexes'string='Database Size' -
stateSelectionselection_add=_STATE_SQL_EDITOR -
technical_nameCharhelp="Suffix of the SQL view. SQL full name will be computed and prefixed by 'x_bi_sql_view_'. Syntax should follow: https://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS"required=True -
tree_view_idMany2one → ir.ui.viewcomodel_name='ir.ui.view'string='Odoo List View' -
view_nameCharcompute='_compute_view_name'help='Full name of the SQL view'store=True -
view_orderChardefault='pivot,graph,list'help='Comma-separated text. Possible values: "graph", "pivot", "list" or "form"'required=True
-
button_create_sql_view_and_model(self) -
button_create_ui(self) -
button_open_view(self) -
button_preview_sql_expression(self) -
button_refresh_materialized_view(self) -
button_reset_to_model_valid(self) -
button_reset_to_sql_valid(self) -
button_set_draft(self) -
button_update_model_access(self) -
check_manual_fields(self, model) -
copy(self, default=None) -
write(self, vals)
New fields (17)
-
bi_sql_view_idMany2one → bi.sql.viewcomodel_name='bi.sql.view'ondelete='cascade'string='SQL View' -
field_contextChardefault='{}'help='Context value that will be inserted for this field in all the views. Important note : please write a context with single quote.' -
field_descriptionCharhelp='This will be used as the name of the Odoo field, displayed for users'required=Truetranslate=True -
graph_typeSelectionselection=_GRAPH_TYPE_SELECTION -
group_operatorSelectionhelp='By default, Odoo will sum the values when grouping. If you wish to alter the behaviour, choose an alternate Group Operator'selection=_GROUP_OPERATOR_SELECTION -
index_nameCharcompute='_compute_index_name' -
is_group_byBooleanhelp="Check this box if you want to create a 'group by' option in the search view"string='Is Group by' -
is_indexBooleanhelp='Check this box if you want to create an index on that field. This is recommended for searchable and groupable fields, to reduce duration' -
is_many2one_clickableBooleandefault=Falsehelp='If the field is of type Many2one and the option is enabled, the field will be clickable on the list view.' -
many2one_model_idMany2one → ir.modelcomodel_name='ir.model'help="For 'Many2one' Odoo field.\n Comodel of the field."string='Model' -
nameCharreadonly=Truerequired=True -
selectionTextdefault='[]'help="For 'Selection' Odoo field.\n List of options, specified as a Python expression defining a list of (key, label) pairs. For example: [('blue','Blue'), ('yellow','Yellow')]"string='Selection Options' -
sequenceIntegerreadonly=Truerequired=Truestring='sequence' -
sql_typeCharhelp='SQL Type in the database'readonly=Truerequired=Truestring='SQL Type' -
stateSelectionrelated='bi_sql_view_id.state'store=True -
tree_visibilitySelectiondefault='available'required=Trueselection=_TREE_VISIBILITY_SELECTION -
ttypeSelectionhelp="Type of the Odoo field that will be created. Keep empty if you don't want to create a new field. If empty, this field will not be displayed neither available for search or group by function"selection=_TTYPE_SELECTIONstring='Field Type'
-
create(self, vals_list)@api.model_create_multi
New fields (0)
No new fields.
Public methods (0)No public methods.
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…