server-tools/base_jsonify/models
Laurent Mignon (ACSONE) 652c0167a3 [IMP] base_jsonify: Allow to export many2one and referene field as simple field
Before this change, the result of the export of a relational field was always a dict or a list of dict.

ex:

<record id="ir_exp_shopinvader_variant_lang" model="ir.exports.line">
  <field name="name">publication_language_id/name</field>
  <field name="alias">publication_language_id/name:lang</field>
  <field name="export_id" ref="shopinvader.ir_exp_shopinvader_variant" />
</record>

will output:
{
    ...
    "publication_language_id" : {
        "lang": "French"
    }
    ...
}

After this change it's now possible to define simple exporter for relational fields where the value into the result will be the display_name or a list of display_name of the related records.

ex:

<record id="ir_exp_shopinvader_variant_lang" model="ir.exports.line">
  <field name="name">publication_language_id</field>
  <field name="alias">publication_language_id:lang</field>
  <field name="export_id" ref="shopinvader.ir_exp_shopinvader_variant" />
</record>

will output:
{
    "lang": "French"
}
 Please enter the commit message for your changes. Lines starting
2020-10-14 08:43:44 +02:00
..
__init__.py [12.0][MIG] base_jsonify: py3 2019-10-18 09:27:45 +02:00
ir_export.py [MIG] base_jsonify: Migration to 13.0 2019-10-18 10:25:57 +02:00
ir_exports_line.py base_jsonify: allow export line exclusion 2020-09-18 09:59:32 +02:00
models.py [IMP] base_jsonify: Allow to export many2one and referene field as simple field 2020-10-14 08:43:44 +02:00