It could happen that a module adds an ir.export.line for a new field
but when tests run the field is not loaded
if this module is not a dependency of the module running tests.
Furthermore, in general, it seems too strict to break the whole computation
if there's a field that is missing.
It seems more reasonable to log an error when this happen
so that technical action can be taken to fix it.
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"
}
(Cherry-pick of 652c0167a after this commit was dropped by #1894's refactoring)
(+ test so that it cannot be forgotten again)
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