| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Lines of code | 717 |
| Technical Name |
json_table_widget |
| License | LGPL-3 |
| Versions | 17.0 18.0 19.0 |
JSON Table Widget
Transform JSON Arrays into Interactive, Editable Tables
Odoo 17 • 18 • 19 | Community & Enterprise Edition
📸 Main Interface Screenshot
💡 What Is JSON Table Widget?
JSON Table Widget is a powerful Odoo widget that instantly converts JSON array data stored in Text/Char fields into beautiful, interactive, Excel-like tables within your Odoo forms.
🎯 Perfect For:
- API Integrations: Display third-party API responses as structured tables
- Data Import/Export: Review and edit staging data before processing
- Dynamic Attributes: Add flexible attributes to products, orders, or custom objects
- Rapid Prototyping: Test data structures without creating formal models
- Operational Dashboards: Quick data review and inline editing
📸 Click-to-Edit Feature
✨ Key Features & Benefits
| Feature | Description |
|---|---|
| Auto-Column Detection | Automatically parses JSON structure and creates table columns. Supports custom ordering and labels. |
| Click-to-Edit Cells | Single-click any cell to edit inline. Press Enter/Tab to save, Esc to cancel. |
| Sticky Headers & Columns | Fixed header row and index/action columns stay visible during scroll. |
| Smart Pagination | Default 50 rows per page (configurable). Handles thousands of records smoothly. |
| Excel Export | One-click CSV export with UTF-8 BOM encoding. Opens perfectly in Excel. |
| Full CRUD Operations | Add new rows, edit existing data, delete entries. All changes save automatically. |
| Read-Only Mode | Display JSON data as a clean table without editing capabilities. |
| Zero Configuration | Works out-of-the-box with any Text/Char field containing JSON arrays. |
🤔 JSON Table Widget vs. One2many Fields
| Feature | JSON Table Widget | One2many Fields |
|---|---|---|
| Setup Complexity | ✓ Instant (no models needed) | ✗ Requires model, views, access rights |
| Data Structure | ✓ Flexible, schema-less JSON | ✗ Fixed database schema |
| Use Case | ✓ Temporary, semi-structured data | ✓ Permanent, relational data |
| API Integration | ✓ Perfect for JSON payloads | ✗ Requires data transformation |
| Prototyping Speed | ✓ Immediate | ✗ Slow (development overhead) |
💡 Recommendation:
Use JSON Table Widget when: Integrating external APIs, prototyping, semi-structured data, avoiding additional database models.
Use One2many when: Mature data structure, advanced filtering needed, audit trails required, large relational datasets (10,000+ records).
🎯 Real-World Use Cases
- 📦 E-Commerce Integration: Display Shopify/WooCommerce order line items from webhooks before processing into Odoo sales orders.
- 📝 API Response Logs: Display structured API responses from payment gateways or shipping carriers.
📖 How to Use
Use the widget in your form view:
<!-- views/your_view.xml --> <field name="json_data" widget="json_table"/>
That's it! The widget automatically renders your JSON array as a table.
2. Advanced Configuration
<field name="json_data"
widget="json_table"
options="{
'empty_text': 'No data available',
'create': true,
'edit': true,
'delete': true,
'page_size': 50,
'export_excel': true
}"/>
3. Expected JSON Format
[
{"name": "John Smith", "age": 32, "department": "Sales", "salary": 65000, "hire_date": "2020-03-15"},
{"name": "Sarah Johnson", "age": 28, "department": "Marketing", "salary": 58000, "hire_date": "2021-06-01"},
{"name": "Michael Chen", "age": 35, "department": "IT", "salary": 75000, "hire_date": "2019-01-10"},
]
📸 XML Configuration in Odoo
⚙️ Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
header_titles |
Object | {} | Custom column labels (e.g., {'sku': 'Product Code'}) |
header_order |
Array | [] | Specify column display order |
empty_text |
String | "No data" | Message shown when table is empty |
create |
Boolean | true | Enable "Add Row" button |
edit |
Boolean | true | Allow editing cell values |
delete |
Boolean | true | Show delete buttons for rows |
page_size |
Number | 50 | Number of rows per page |
export_excel |
Boolean | true | Show "Export to Excel" button |
🚀 Installation
- Download the module from Odoo Apps Store
- Extract and copy to your Odoo addons directory
- Restart your Odoo server
- Go to Apps → Update the apps list
- Search for "JSON Table Widget" and click Install
- Start using widget="json_table" in your form views!
❓ Frequently Asked Questions
Q: Can I use this widget with existing database fields?
A: Yes! If you have Text or Char fields containing JSON arrays, simply add widget="json_table" to your form view. No data migration required.
Q: Does it work with nested JSON objects?
A: The widget handles one level of nesting. Nested objects within cells are displayed as JSON strings and can be edited.
Q: Can I add new columns dynamically?
A: Columns are detected from JSON keys. To add a new column, edit the JSON to include the new key in at least one object.
Q: Is it compatible with Odoo mobile apps?
A: The widget is optimized for desktop and tablet web browsers. Mobile phone support is limited due to table scrolling constraints.
Q: Can I use this in list/kanban views?
A: Currently designed for form views only. In list/kanban views, the JSON field displays as standard text.
🤝 Need Help? We're Here for You
Stuck with installation? Want to extend the widget?
📧 Email us at honghonggz@outlook.com
We typically respond within 24 hours
Please log in to comment on this module