Odoo 20 vs 19: read_group() Is No Longer Deprecated (What to Call Instead)
Do Incredible
0:00 / 0:00
Odoo 20 vs 19: read_group() Is No Longer Deprecated (What to Call Instead)
24 просмотра · 12 дней назад
Do Incredible
31 подписчик
24 просмотра · 12 дней назад
In Odoo 19, the public read_group() method on every model is marked @api.deprecated — it still works, but it points you at _read_group() or formatted_read_group() instead. In Odoo 20 (currently the master pre-release), read_group() is public again, but its signature changed completely: it now takes the same (domain, groupby, aggregates) shape as the private _read_group() it wraps, and returns plain tuples instead of dictionaries.
This video runs the numbers, not just the docs. On a real Odoo 20 database I call read_group() the old Odoo 19 way and watch it fail with a TypeError, call it with the old argument order and watch it fail with a ValueError that Odoo 19 gives for the exact opposite mistake, and then call it the correct Odoo 20 way and get a clean list of tuples back — all from a tiny wizard module built for this video and installed live.
You will see: the real Odoo 19 source with its @api.deprecated decorator, a captured Odoo 19 shell session showing the deprecation warning and the dict result, the Odoo 20 source with @typing.final and no deprecation anywhere, why the exact same error message means two different things depending on which version you're running, and the one-line change (calling _read_group() directly) that works on both versions today.
Chapters:
00:00 Hook
00:19 Introduction
01:02 The Odoo 19 signature, and why it's deprecated
01:49 The old call, captured live
02:29 Odoo 20 makes it public again — and final
03:14 See it live: three calls, one click
03:54 Same error, opposite reasons
04:41 What to change in your code today
05:17 Wrap-up
---
Do Incredible builds and ships Odoo apps. Every video is recorded on a real Odoo database.
Website: https://www.doincredible.com
#Odoo #OdooDevelopment
#Odoo #Odoo20 #OdooDevelopment #Python