Skip to content
Health
85/100
good
  • Security25/25
    No findings
  • Activity20/25
    Last human commit 10 months ago
  • Required by15/25
    1 module depends on it
  • Maturity25/25
    In 12 Odoo series since 8.0

Heuristic over the facts below, not an audit · How it's computed

Security findings
Grave / minor (static analysis)
Required by
1
Modules depending on it
External deps
0 pip · 0 bin
Python packages / system binaries
License
AGPL-3
No conflicts with its dependencies
Folder size
0.79 MB
Module directory on disk
Code analysis 0 migration notes 1 model 2 views 0 HTTP endpoints

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.

Dependencies

Odoo dependencies
odoo/odoo:
- web
- bus
Python dependencies
None
System dependencies
None
Required by
bi_sql_editor

Code analysis

Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.

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…

Loading…