Skip to Content
Menu

YLHC Inline Script

by
Odoo

197.48

v 16.0 Third Party
Live Preview
Availability
Odoo Online
Odoo.sh
On Premise
Lines of code 114
Technical Name ylhc_inline_script
LicenseOPL-1
Websitehttps://www.ylhctec.com
Versions 16.0 17.0 18.0
You bought this module and need support? Click here!
Availability
Odoo Online
Odoo.sh
On Premise
Lines of code 114
Technical Name ylhc_inline_script
LicenseOPL-1
Websitehttps://www.ylhctec.com
Versions 16.0 17.0 18.0
YLHC Inline Script Banner

🚀 YLHC Inline Script

Powerful Script Integration for Odoo Form Views

✨ Overview

YLHC Inline Script Icon

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:

<form> <field name="name"/> <field name="email"/> <script> // Your custom JavaScript code console.log('Form loaded with record:', context.record); // Access field values const name = context.utils.getFieldValue('name'); // Update field programmatically if (!name) { context.utils.updateField('name', 'Default Name'); } // Get DOM elements const emailField = context.utils.getField('email'); if (emailField) { emailField.addEventListener('change', function() { console.log('Email changed:', this.value); }); } </script> </form>

🎯 Use Cases & Benefits

Dynamic Form Validation: Implement complex validation logic
Field Interactions: Create dependent fields and conditional logic
Real-time Calculations: Perform live calculations and updates
Enhanced UX: Add interactive elements and improved user experience
API Integration: Connect with external services and APIs
Custom Widgets: Create custom form widgets and components

🛠️ Technical Specifications

System Requirements

Odoo Version: 18.0+
Dependencies: base, web
Framework: OWL (Odoo Web Library)
License: LGPL-3

Context API Available

context = { component: // Form component instance record: // Form record data env: // Component environment props: // Component props el: // DOM element utils: { getFieldValue(fieldName), getFieldElement(fieldName), getField(fieldName), updateField(fieldName, value), getFormData(), triggerFieldChange(fieldName, value) } }

📦 Installation

1

Download

Download the module from Odoo Apps Store or get it from the repository

2

Install

Place the module in your Odoo addons directory and update the apps list

3

Activate

Install the module from the Apps menu in your Odoo instance

4

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.

Ready to enhance your Odoo forms?

Get started with YLHC Inline Script today and transform your form views into powerful, interactive experiences!

Author: YLHC | Version: 1.1 | Category: Technical | Get Support

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

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author or have a question related to your purchase, please use the support page.