| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Lines of code | 418 |
| Technical Name |
mw_json_table |
| License | OPL-1 |
| Website | http://@_@ |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Lines of code | 418 |
| Technical Name |
mw_json_table |
| License | OPL-1 |
| Website | http://@_@ |
JSON Table Field (OWL) — Dynamic, Editable Tables inside Odoo Forms
Create configurable, spreadsheet-like tables in any Odoo model using a single Json field.
Add/rename/remove columns, switch types (text, selection, boolean, image),
manage options, edit rows, and export to CSV — all from the form view.
Why this module?
Dynamic schema
Business users can design columns on the fly: add, rename, delete, and change types without developer changes.
Multiple input types
- Text
- Selection (with options)
- Boolean
- Image (Data URL, size-limited)
CSV Export
One click to export the visible grid to CSV with a UTF-8 BOM; images are marked as "Image Data".
Visual Comparison — Raw JSON vs JSON Table
See how the JSON Table Widget transforms a raw technical JSON editor into a clear, editable, user-friendly interface.
Before: Standard JSON Field
Default Odoo JSON editor — plain text, not friendly for non-technical users.
After: JSON Table Widget
Dynamic, interactive grid with editable columns, selections, booleans, and image upload.
🎬 Live Demo — JSON Table in Action
Watch how the JSON Table Widget makes editing structured data effortless — adding columns, changing types, uploading images, and exporting to CSV, all inside Odoo.
Look & Feel
Editable header + types
Rows with text/boolean/selection
Dynamic Add Row, Column CSV export
Installation
- Copy the module into your addons path.
- Update App list and install.
- Ensure your model has a
fields.Jsonfield to store the data.
widget="json_table" and (optionally) pass options.
Usage (XML + Field)
<!-- Python model -->
from odoo import models, fields
class ChecklistJob(models.Model):
_name = "mw.checklist.job"
task_data = fields.Json(string="Task Data") # stores {columns: [...], rows: [...]}
<!-- XML form view -->
<field name="task_data" widget="json_table"
options="{'hide_column_controls': False}"/>
The widget writes back a single JSON structure to the field whenever you edit:
{
"columns": [
{"name": "Room", "type": "text"},
{"name": "Checked", "type": "boolean"},
{"name": "Quarter", "type": "selection", "options": ["Q1","Q2","Q3","Q4"]},
{"name": "Photo", "type": "image"}
],
"rows": [
{"Room": "101", "Checked": true, "Quarter": "Q2", "Photo": "data:image/png;base64,..."}
]
}
Widget options
| Option | Type | Default | Description |
|---|---|---|---|
hide_column_controls |
Boolean | false |
Hide "Add column", rename/type/options controls; useful for read-only schemas. |
Limits & safeguards
- Images: client-side size check <= 2 MB; stored as Data URL in the JSON field.
- CSV Export: adds BOM for Excel compatibility; boolean → "True/False", images → "Image Data".
- Type changes: switching a column's type resets its cell values to sensible defaults.
Changelog
18.0.1.0.0
- Initial release: dynamic columns, 4 input types, CSV export, image preview & delete.
- Prop:
hide_column_controls, better notifications, robust write-back.
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