Base Jsonify

Base Jsonify

by Contaura LLC · original work by Akretion, OCA
base_jsonify
$ 29.00

Base module that provide the jsonify method on all models

1.0

One purchase covers every version. Already bought it? Sign in.

Base Jsonify

This module adds a ‘jsonify’ method to every model of the ORM. It works on the current recordset and requires a single argument ‘parser’ that specify the field to extract.

Example of parser:

parser = [
    'name',
    'number',
    'create_date',
    ('partner_id', ['id', 'display_name', 'ref'])
    ('line_id', ['id', ('product_id', ['name']), 'price_unit'])
]

In order to be consitent with the tulio api the jsonify method always return a list of object even if there is only one element in input

By default the key into the json is the name of the field extracted from the model. If you need to specify an alternate name to use as key, you can define your mapping as follow into the parser definition:

parser = [
    'field_name:json_key'
]
parser = [
    'name',
    'number',
    'create_date:creationDate',
    ('partner_id:partners', ['id', 'display_name', 'ref'])
    ('line_id:lines', ['id', ('product_id', ['name']), 'price_unit'])
]

Also the module provide a method “get_json_parser” on the ir.exports object that generate a parser from an ir.exports configuration.

Table of contents

Technical namebase_jsonify
Module version12.0.1.1.2
Tulio versions1.0
CategoryTools
PublisherContaura LLC
Ported to Tulio, tested and supported by Contaura LLC.
Original authorsAkretion, OCA
LicenseAGPL-3
Open source: you may use, change and share this module under its license. The price covers the Tulio port, its testing on Tulio 1.0 and the download.
Requires (Tulio core)base
Lines of code376
Downloads0
Released12/06/2026
12.0.1.1.2 Tulio 1.0 · 12/06/2026