DEV Community

Khaled Said
Khaled Said

Posted on

Migrating XML Views in Odoo 19.0: Removing Deprecated `<group>` Properties

With the release of Odoo 19.0, several changes were introduced to the XML view engine. One of the most impactful adjustments relates to the <group> tag in search views. If you’ve recently upgraded, you may have encountered the dreaded error:

View error context: -no context-
Enter fullscreen mode Exit fullscreen mode

This error is directly tied to deprecated properties inside <group> tags.


❌ What Changed?

In earlier versions of Odoo, developers often used <group> with properties such as:

<group expand="0" string="Group By">
    <filter name="user_id" string="User" context="{'group_by': 'user_id'}"/>
</group>
Enter fullscreen mode Exit fullscreen mode

However, starting from Odoo 19.0, the following attributes are no longer supported:

  • expand="0"
  • name="group_by"
  • string="Group By"

These properties now trigger errors because the view rendering engine has been refactored. The change is documented in the official Odoo commit:

πŸ‘‰ Commit a814ad6b18da68370376d5cce26e06434cde704f


βœ… How to Fix It

You should remove the unsupported properties and keep only the valid <filter> definitions inside <group>. For example:

Old (pre-19.0)

<group expand="0" string="Group By">
    <filter name="user_id" string="User" context="{'group_by': 'user_id'}"/>
</group>
Enter fullscreen mode Exit fullscreen mode

New (19.0+)

<group>
    <filter name="user_id" string="User" context="{'group_by': 'user_id'}"/>
</group>
Enter fullscreen mode Exit fullscreen mode

πŸ›  Migration Checklist

  1. Search your codebase for <group> tags which has such attributes in XML views.
  2. Remove deprecated attributes (expand, name, string).

πŸ“Œ Conclusion

This change may seem minor, but it’s crucial for a smooth migration to Odoo 19.0. By cleaning up your XML views and removing deprecated <group> properties, you’ll avoid runtime errors and ensure compatibility with the view engine.

Top comments (0)