app icon
Odoo
Cyllo

SQL Request Abstract

This module, named "SQL Request Abstract," acts as a foundation for building functionalities related to managing and executing SQL SELECT queries within the Odoo framework. While it doesn't directly serve a purpose on its own, it lays the groundwork for other modules like "bi_sql_editor" and "sql_export" to leverage its capabilities.

This module implements several key features to enhance the management of SQL Select requests in the database:

Firstly, it adds restrictions to the SQL requests, allowing only data reading operations. Updates, deletions, or creations are not permitted to ensure data integrity and security. Additionally, certain tables, such as 'ir_config_parameter', are restricted due to their sensitive nature, as they may contain clear passwords or keys.

Furthermore, SQL requests can exist in either a 'draft' or 'SQL Valid' status. To attain the 'SQL Valid' status, requests must undergo cleaning, checking, and testing processes. These operations can be optionally disabled in inherited modules, providing flexibility in workflow management.

Additionally, this module introduces two new user groups: 'SQL Request / User' and 'SQL Request / Manager'. Users belonging to the 'SQL Request / User' group have default access to view and execute SQL requests, provided they are valid. On the other hand, users in the 'SQL Request / Manager' group have full access rights, enabling them to manage SQL requests comprehensively.

To utilize the functionality ,inherit the model in your custom module. Import the necessary modules and define your model class as shown below.

                    
                        from odoo import models

                        class MyModel(models.Model):
                            _name = 'my.model'
                            _inherit = ['sql.request.mixin']

                            _sql_request_groups_relation = 'my_model_groups_rel'
                            _sql_request_users_relation = 'my_model_users_rel'
                    
                

You can reference the implementations in the modules 'bi_sql_editor' or 'sql_export' for guidance and inspiration. These modules demonstrate practical use cases and implementations of the SQL request functionality provided by this module.

Key Features

  • Manages SQL SELECT queries (abstract model).
  • Read-only access for data security.
  • Restricted access to sensitive tables.
  • Multi-stage query validation process.
  • User group access control (SQL Request users/managers).
Centralized Structure

This module acts as a foundation, providing a unified structure for managing various aspects of SQL SELECT queries within Odoo. This simplifies development for other modules that need functionalities related to working with SQL queries, saving time and effort.

Enhanced Data Security

To safeguard your data, the module enforces a read-only approach. This means it can only retrieve information from the database, preventing any unintended modifications, deletions, or creation of data. This helps maintain data integrity and prevents potential security risks.

Robust Query Validation

Before executing a SQL request, the module puts it through a multi-stage validation process. This includes cleaning the query syntax, checking its functionality, and testing it to ensure accuracy and security. This validation process helps catch errors and prevent unintended consequences before the query interacts with your data.

Granular User Group Management

The module implements access control through two user groups:
SQL Request / User: View and execute valid SQL requests for data retrieval.
SQL Request / Manager: Full access to manage all functionalities and user permissions.

Disabled tab content

GNU Affero General Public License v3.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you comply with the terms of the GNU Affero General Public License, version 3.0, available at https://www.gnu.org/licenses/agpl-3.0.html. You may develop software that uses the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those software under the terms of the GNU Affero General Public License, version 3.0. It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software without including the complete text of the GNU Affero General Public License, version 3.0, along with any applicable additional permissions. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Free
0
Technical Name sql_request_abstract
License AGPL-3
Lines of Code 2166
  • mail
You bought this module and need support? Click Here!