Files
odoo_source/addons/web
Lucas Perais c1db28a260 [FIX] web: views: x2many form_view_ref when field already present and invisible
Have a form view that has twice the same x2many field, excpet the first one is invisible=1.
The second occurence has a context with the form_view_ref key.

The x2many should have at least one record.

```xml
<form>
    <field name="x2m" invisible="1" />
    <field name="x2m" context="{'form_view_ref': 'some_ref'}">
        <tree>
            <field name="display_name" />
        </tree>
    </field>
</form>
```

When opening a record, the context was not taken into account, yielding the wrong form view to open that record.

After this commit, the form_view_ref context key is taken into account, and the right form view opens.

opw-3845448

closes odoo/odoo#161253

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2024-04-10 17:30:52 +00:00
..
…