Repository
OCA/reporting-engine · module folder · Try on Runboat
Module version
1.0.0
Category
Tools
Folder size
0.79 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
Akretion, Odoo Community Association (OCA), GRAP
Maintainers
Akretion, Odoo Community Association (OCA), GRAP
Committers
Weblate, Franco Leyes, OCA-git-bot, oca-ci
Odoo dependencies
odoo/odoo:
- web
- bus
Python dependencies
None
System dependencies
None
Required by
bi_sql_editor
Description
This module provides an abstract model to manage SQL Select requests on
database. It is not usefull for itself. You can see an example of
implementation in the 'sql_export' module. (same repository).

## Implemented features

- Add some restrictions in the sql request:  
  - you can only read datas. No update, deletion or creation are
    possible.
  - some tables are not allowed, because they could contains clear
    password or keys. For the time being ('ir_config_parameter').

- The request can be in a 'draft' or a 'SQL Valid' status. To be valid,
  the request has to be cleaned, checked and tested. All of this
  operations can be disabled in the inherited modules.

- This module adds two new groups:  
  - SQL Request / User : Can see all the sql requests by default and
    execute them, if they are valid.
  - SQL Request / Manager : has full access on sql requests.

Code Analysis

Views touched (2)
XML IDNameModelTypeStatus
view_sql_request_mixin_form sql.request.mixin form New
view_sql_request_mixin_tree sql.request.mixin list New
HTTP endpoints (0)

No HTTP endpoints found for this module.

Models touched (1)

New fields (8)
  • group_ids Many2many → res.groups
    column1='sql_id' column2='group_id' comodel_name='res.groups' default=<expr> relation=_sql_request_groups_relation string='Allowed Groups'
  • has_group_changed Boolean
    copy=False help='Technical fields, used in modules that depends on this one to know if groups has changed, and that according access should be updated.'
  • name Char
    required=True
  • note Html
  • query Text
    help="You can't use the following words: DELETE, DROP, CREATE, INSERT, ALTER, TRUNCATE, EXECUTE, UPDATE." required=True
  • state Selection
    default='draft' help="State of the Request:\n * 'Draft': Not tested\n * 'SQL Valid': SQL Request has been checked and is valid" selection=STATE_SELECTION
  • use_external_database Boolean
    help='If filled, the query will be executed against an external database, configured in Odoo main configuration file. '
  • user_ids Many2many → res.users
    column1='sql_id' column2='user_id' comodel_name='res.users' default=<expr> relation=_sql_request_users_relation string='Allowed Users'
Public methods (5)
  • button_preview_sql_expression(self)
  • button_set_draft(self)
  • button_validate_sql_expression(self)
  • check_external_config(self)
    @api.constrains('use_external_database')
  • onchange_group_ids(self)
    @api.onchange('group_ids')

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…