✨ Overview

YLHC Inline Script is a cutting-edge Odoo module that extends the FormCompiler to support <script> nodes directly in form views. This powerful enhancement enables developers to create dynamic, interactive forms with custom JavaScript logic while maintaining security and performance.
🔥 Key Features
Enhanced Script Processing
Advanced script node processing with useEffect execution in React-style lifecycle management for optimal performance.
Context Variable Replacement
Intelligent context variable replacement (e.g., __FORM_CONTEXT__ → __comp__.props.record) for seamless data access.
Safe Script Execution
Comprehensive error handling and secure script execution environment with built-in logging and debugging support.
Component-Based Architecture
Uses ScriptExecutor component with modern React hooks for efficient script lifecycle management.
Rich API Access
Provides comprehensive access to form data, field elements, and utility functions for maximum flexibility.
Performance Optimized
Base64 encoding for script content preservation and optimized execution patterns for better performance.
💡 How It Works
The module patches Odoo's FormCompiler and FormRenderer to recognize and process <script>
tags in form view XML files. Here's a simple example:
🎯 Use Cases & Benefits
🛠️ Technical Specifications
System Requirements
Context API Available
📦 Installation
Download
Download the module from Odoo Apps Store or get it from the repository
Install
Place the module in your Odoo addons directory and update the apps list
Activate
Install the module from the Apps menu in your Odoo instance
Use
Start adding <script> tags to your form views and enjoy the enhanced functionality!
🎪 Testing Module Included
The module comes with a comprehensive testing module (ylhc_inline_script_test
) that includes:
Test Scenarios
Multiple test scenarios including basic, context, interactive, performance, and error handling tests
Test Models
Dedicated test models and views for comprehensive functionality testing
Monitoring
Script execution monitoring and logging for debugging and optimization
🚀 Why Choose YLHC Inline Script?
YLHC Inline Script bridges the gap between Odoo's powerful backend and the need for dynamic frontend interactions. Whether you're building complex business applications or simple interactive forms, this module provides the tools and flexibility you need.
With its robust architecture, comprehensive error handling, and extensive API, you can create sophisticated user experiences while maintaining code quality and system security.
Please log in to comment on this module