| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
Discuss (mail)
|
| Community Apps Dependencies | Show |
| Lines of code | 2075 |
| Technical Name |
nk_report_ai_dynamic |
| License | OPL-1 |
| Website | https://www.odoo.com |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
Discuss (mail)
|
| Community Apps Dependencies | Show |
| Lines of code | 2075 |
| Technical Name |
nk_report_ai_dynamic |
| License | OPL-1 |
| Website | https://www.odoo.com |
🤖 NK AI Report Builder BETA
AI-Powered Dynamic Reports with SQL Generation for Odoo v17
Transform your reporting workflow with AI-powered dynamic report generation. Simply describe what you need in natural language, and the AI generates the SQL query automatically. No deep SQL expertise required.
Version 17.0.0.9.0 (BETA) | Compatible with Odoo Community v17.0 | Enterprise edition not required
⚠️ BETA VERSION NOTICE
This module is currently in BETA testing phase.
Please be aware that:
- Some features may be incomplete or subject to change
- You may encounter bugs or unexpected behavior
- API integrations and functionality are still being refined
- We recommend testing in a non-production environment first
Your feedback is valuable! Please report any issues or suggestions to help us improve the module.
💰 Beta Pricing
Currently in BETA - Special Discounted Price!
This module is currently available at a discounted price of €22.00 during the beta testing phase.
Note: The original price will be restored once the module reaches stable release. Early adopters who purchase during beta will keep their discounted rate.
⚠️ IMPORTANT: API Requirements and Costs
🔑 API Key Required
This module REQUIRES a valid OpenAI API key to function.
You must obtain your own API key from OpenAI Platform. The module price does NOT include OpenAI API usage costs.
💰 Who Pays for API Usage?
OpenAI usage costs are NOT included in the module price.
You are responsible for all OpenAI API costs. Usage is billed directly by OpenAI based on:
- Model selected (GPT-4, GPT-3.5, GPT-4o, etc.)
- Number of tokens used (input + output)
- Your OpenAI account's pricing tier
- Complexity of your report requests
Without valid API credits, the module will not function. The app requires an active OpenAI account with available credits to generate SQL queries.
🔒 Data Privacy and Security
What data is sent to OpenAI?
Yes, data is sent externally to OpenAI's servers. The following information is transmitted:
- Model metadata: Field names, types, and relationships (up to 3 levels deep)
- User queries: Your natural language report requests (e.g., "most sales products in last month")
- Context information: Date ranges and additional context you provide
- System prompts: Instructions for SQL generation
⚠️ Actual database records are NOT sent to OpenAI. Only metadata (field names, types) and your queries are transmitted. The AI generates SQL queries based on this information, but never sees your actual data.
Is it safe? OpenAI uses industry-standard encryption (HTTPS/TLS) for all API communications. However, you should review OpenAI's Privacy Policy and Data Usage Policies to understand how they handle API data.
📋 Overview
NK AI Report Builder revolutionizes report generation in Odoo by allowing users to create custom reports using natural language. Simply describe what you want, and AI generates the SQL query automatically. The system validates queries to ensure they're read-only and safe, then executes them to produce dynamic reports.
No deep SQL expertise required. Ask questions like "most sales products in last month" or "top customers by revenue" and get instant, accurate reports.
✨ Features
🗣️ Natural Language Reports
Describe what you need in plain English. AI understands your request and generates the appropriate SQL query.
🔍 Deep Field Discovery
Automatically discovers fields up to 3 levels deep (e.g., sale.order → sale.order.line → stock.move.line).
📅 Date Range Filters
Predefined date ranges (Last 7/30/90/365 days, This/Last Month/Year) plus custom date ranges.
🛡️ SQL Validation
Advanced validation with word-boundary checks ensures only read-only SELECT queries are executed. Prevents false positives on field names like create_date.
📊 Dynamic Display
Results displayed in a clean, readable table format with all columns and data properly formatted. SQL syntax highlighting for better readability.
📥 Export Options
Export reports to Excel (.xlsx) or PDF format for sharing and archiving. Attach Excel files directly to chatter for easy sharing.
🧠 AI Learning from Errors
When SQL execution fails, error details are automatically added to context. AI learns from previous errors to generate better queries on regeneration.
⚡ Robust Error Handling
Transaction-safe error handling ensures error messages are saved even during transaction rollbacks. Better error recovery and user feedback.
📥 Installation & Setup
Prerequisites
- Odoo Version: 17.0 Community Edition or Enterprise Edition
- NK OpenAI Base: This module must be installed first
- OpenAI API Key: Configured in NK OpenAI Base module settings
- Note: Excel and PDF exports use Odoo's built-in libraries (no external dependencies required)
Installation Steps
- Install NK OpenAI Base Module
First, install the NK OpenAI Base module (FREE, available separately). This module provides the OpenAI API integration.
- Get Your OpenAI API Key
You need an OpenAI API key to use this module. See the detailed setup guide below.
- Install NK AI Report Builder
Install this module from the Odoo App Store or repository.
- Configure OpenAI Settings
Navigate to Settings → OpenAI Integration section in Odoo.
- Enable OpenAI Integration
Check the "Enable OpenAI Integration" checkbox.
- Enter API Key
Enter your OpenAI API key in the "OpenAI API Key" field.
- Configure Model and Settings
Select your preferred model and adjust timeout/token limits as needed.
- Enable User Group for Access
Go to Settings → Users & Companies → Users → Select user → Access Rights tab → Check "AI Report Builder / User" (or "AI Report Builder / Administrator" for full access).
⚠️ IMPORTANT: Users must have this group enabled to access the module!
- Access Reports
Navigate to AI Reports → Report Builder from the main menu.
🔑 How to Get Your OpenAI API Key
Step-by-Step Guide:
-
Visit OpenAI Platform
Go to https://platform.openai.com
-
Sign Up or Log In
Create a new account or sign in to your existing OpenAI account.
-
Navigate to API Keys
Click on your profile icon (top right) → Select "API keys" from the menu.
Or go directly to: https://platform.openai.com/api-keys
-
Create New API Key
Click the "Create new secret key" button.
Give it a name (e.g., "Odoo AI Report Builder") and click "Create secret key".
-
Copy Your API Key
⚠️ IMPORTANT: Copy the API key immediately! You won't be able to see it again after closing the dialog.
The API key will look like:
sk-proj-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -
Add Billing Information
OpenAI requires a valid payment method to use the API. Go to "Billing" → "Payment methods" to add your credit card.
You can set usage limits to control costs.
-
Paste API Key in Odoo
Go to Odoo → Settings → OpenAI Integration → Paste your API key in the "OpenAI API Key" field.
-
Enable User Group for Access
Go to Settings → Users & Companies → Users
Select the user(s) who need access to AI Report Builder
In the user form, go to the "Access Rights" tab
Under "Application Accesses", find and check "AI Report Builder / User" (or "AI Report Builder / Administrator" for full access)
⚠️ IMPORTANT: Users must have this group enabled to access the module features!
💡 Important Notes:
- API Key Security: Never share your API key publicly or commit it to version control. Treat it like a password.
- Usage Costs: OpenAI charges based on usage (tokens used). Monitor your usage in the OpenAI dashboard.
- Free Credits: New accounts may receive free credits to get started. Check your OpenAI account for available credits.
- Rate Limits: Different models have different rate limits (TPM/RPM). See the model selection dropdown for details.
- Billing Alerts: Set up billing alerts in your OpenAI account to monitor costs and usage.
⚙️ Recommended Configuration
For optimal performance and best results, we recommend the following configuration in Settings → OpenAI Integration (via NK OpenAI Base module):
| Setting | Recommended Value | Notes |
|---|---|---|
| Enable OpenAI Integration | ✅ Enabled | Required for AI functionality |
| OpenAI Model | GPT-5 Mini | 500K TPM, 500 RPM - Best balance of speed and quality |
| OpenAI Base URL | https://api.openai.com/v1 | Default OpenAI API endpoint |
| API Type | Responses API | Advanced features, tools, structured outputs |
| API Timeout | 60 seconds | Sufficient for most queries |
| Organization ID | Optional | Only if using multiple organizations |
| Project ID | Optional | Only if using project-based organization |
| Custom Model Name | Leave empty | Use selected model from dropdown |
💡 Why These Settings?
- GPT-5 Mini: Offers excellent performance (500K TPM) with good quality results, making it ideal for SQL generation tasks.
- Responses API: Provides advanced features like structured outputs and better handling of complex queries.
- 60 Second Timeout: Balances between allowing complex queries to complete and preventing long waits.
🚀 Usage
Creating a Report
- Select Model
Choose the Odoo model you want to report on (e.g., sale.order, account.move, product.product).
- Enter Report Request
Describe what you want in natural language. Examples:
- "most sales products in last month"
- "top 10 customers by revenue this year"
- "average order value by salesperson"
- "products with low stock levels"
- Select Date Range
Choose from predefined ranges or set a custom date range.
- Add Context (Optional)
Provide additional context to help AI understand your requirements better.
- Generate SQL
Click "Generate SQL" to let AI create the query based on your request.
- Validate SQL
System automatically validates the query to ensure it's safe and read-only.
- Execute Query
Once validated, execute the query to see results.
- Export Results
Export to Excel or PDF for further analysis or sharing.
Example Use Cases
Sales Analysis
"Show me top 20 products by sales amount in the last quarter"
Customer Insights
"List customers with highest order values this year"
Inventory Reports
"Products with stock below reorder level"
Financial Reports
"Monthly revenue breakdown for current year"
🔧 Technical Details
Field Discovery
The system automatically discovers fields in the selected model up to 3 levels deep:
- Level 1: Direct fields of the selected model
- Level 2: Fields from related models (many2one, one2many, many2many)
- Level 3: Fields from models related to level 2 models
For each field, the system provides:
- Field name
- Field type (integer, float, char, date, many2one, etc.)
- Whether the field is stored in database
- Source model information
SQL Validation
The system performs comprehensive validation to ensure query safety:
- ✅ Only SELECT queries are allowed (read-only operations)
- ✅ Blocks all data modification operations (INSERT, UPDATE, DELETE, DROP, ALTER, CREATE, TRUNCATE are rejected)
- ✅ Uses word-boundary regex patterns to prevent false positives (e.g., create_date field name won't trigger CREATE keyword detection)
- ✅ Prevents multiple statement execution (SQL injection protection)
- ✅ Validates query structure and syntax before execution
- ✅ Automatic validation on Execute button click
AI Error Learning
The system includes intelligent error handling and learning:
- ✅ When SQL execution fails, error details are automatically captured and added to context
- ✅ Error messages are saved even during transaction rollbacks (transaction-safe error handling)
- ✅ AI receives formatted error context when regenerating SQL queries
- ✅ This allows AI to learn from previous errors and generate better queries
- ✅ User-friendly error messages in chatter with actionable guidance
AI Prompt Engineering
The AI receives comprehensive context including:
- User's natural language request
- Selected Odoo model and table name
- All available fields (up to 3 levels deep)
- Date range constraints
- Additional user context
- Previous error context (if any SQL execution failed before)
- Column naming requirements for user-friendly headers
This ensures accurate SQL generation that matches your requirements and adapts to your specific Odoo installation.
🔐 Security
🛡️ Built-in Security Features
- Read-Only Enforcement: Only SELECT queries are allowed. All data modification operations are blocked.
- SQL Injection Protection: Multiple statement execution is prevented.
- Access Control: Users can only access their own reports (unless they're system administrators).
- Query Validation: All queries are validated before execution.
- Error Handling: Safe error messages that don't expose sensitive information.
✅ Compatibility
Odoo Versions
- ✅ Odoo Community v17.0 (Fully tested and supported)
- ✅ Odoo Enterprise v17.0 (Compatible, but Enterprise edition not required)
✓ Compatible with Odoo Community v17.0
✓ Enterprise edition NOT required
Dependencies
- ✅ base (core Odoo)
- ✅ web (Odoo web framework)
- ✅ mail (for chatter functionality)
- ✅ nk_openai_base (required - provides OpenAI integration)
- ✅ Valid OpenAI API key (required for functionality)
Export Features
- ✅ Excel export (uses Odoo's built-in xlsxwriter)
- ✅ PDF export (uses Odoo's built-in QWeb reports)
📝 Release Notes
Beta Release 17.0.0.9.0 (2025-12-16)
⚠️ This is a BETA release. Features may be incomplete or subject to change.
✨ New Features
- Initial release of NK AI Report Builder module
- AI-powered dynamic report generation from natural language
- 3-level deep field discovery
- Date range filters (predefined and custom)
- SQL query validation (read-only enforcement)
- Dynamic report display with HTML rendering
- Export to Excel and PDF formats
- Chatter integration for tracking
- State-based workflow
- SQL syntax highlighting
- User-friendly column names
- Automatic SQL validation on Execute
- AI error learning - Context from previous errors improves future queries
- Enhanced SQL validation - Word-boundary checks prevent false positives
- Transaction-safe error handling - Errors saved even during rollbacks
- Excel attachment to chatter - Share reports directly in conversations
🔧 Improvements
- Enhanced SQL query validation with word-boundary regex patterns
- Improved AI prompt for better column names
- Better SQL syntax highlighting with proper string protection
- Enhanced error handling with transaction-safe error persistence
- AI error learning - automatic context building from execution errors
- Improved security with custom groups
- Better UI with Odoo v17 format
- Improved chatter message formatting with proper HTML rendering
🐛 Fixes
- Fixed Excel export using Odoo's native xlsxwriter
- Fixed PDF export using Odoo's QWeb reports
- Fixed attachment format for message_post
- Fixed form view refresh after button clicks
- Fixed SQL query extraction from AI responses
- Fixed HTML rendering for results
- Fixed state-based field editability
- Fixed SQL validation false positives (create_date field no longer triggers CREATE keyword)
- Fixed error context saving during transaction rollbacks
- Fixed chatter HTML message rendering (proper Markup usage)
- Fixed QWeb report template (removed t-field from td elements)
🗑️ Removed
- Removed openpyxl dependency
- Removed reportlab dependency
⚠️ Current Limitations
📊 Performance
- Large result sets may take time to process
- Complex queries with many JOINs may be slower
- Field discovery limited to 3 levels deep
🔧 Technical
- SQL queries must be SELECT-only (read-only)
- Large result sets may require pagination in exports
- AI response quality depends on model selection
- Context window limits may affect complex models
🎨 Features
- Single model per report
- Limited to PostgreSQL-compatible SQL
- No query optimization suggestions
🚀 Future Planning
Planned Improvements
We're continuously working to improve NK AI Report Builder. Planned improvements include:
- Report templates and saved queries
- Scheduled report generation
- Multi-model report support
- Advanced filtering and grouping options
- charts and visualizations
- Export to additional formats (CSV, JSON)
- Query history and versioning
- AI-powered query optimization
- Support for subqueries and CTEs
Support & Resources
Need help? Have questions? We're here to assist you!
📧 Support
Contact our support team for assistance with installation, configuration, or any questions.
📚 Documentation
Comprehensive documentation is available in the module's README file and inline help texts.
© 2025 NK Interactive. All rights reserved.
NK AI Report Builder for Odoo v17 | License: OPL-1 (Odoo Proprietary License v1.0)
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use 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 modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. 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.
Please log in to comment on this module