Daily updates from Odoo
Tuesday, July 25, 2023
1 change · master
Resolved issues and error corrections
This fix prevents Odoo Studio from crashing when users navigate from a form to edit a related list that includes contextual field settings. It makes the editing flow more reliable for customized forms with existing related records.
Original PR description
Have a form view like:
```xml
<form>
<field name='product_ids'>
<tree>
<field name="m2o" context="{'context_key': 'value', 'parent': parent.id}" />
</tree>
</field>
</form>
```
In studio, edit this view Form and navigate to edit the X2many List View. (provided that the form's record has at least one record in its X2Many, which has its m2o field set).
Before this commit there was a crash as the new RelationalModel couldn't evaluate the "parent" key in the context.
There was an asymmetry between the list and the form view in this flow, because we did not do exactly the same thing to put "parent" in the context. Namely, in the form view, we pushed that key in the config.context, which, happened to be the same Object as params.context.
This commit is the occasion to harmonize all this and make this flow more robust.