d50db0587bad3b139b82aff645c108cb5148a315
When looking to fetch grouped data from the database, `read_group` should work(-ish), especially with support for `array_agg`. This also means this need should be more or less solved around RPC: client can either `read_group` or group on the client side. This leaves a glaring hole in the fabric: there's no convenient tools to apply grouping to recordsets. `itertools.groupby` exists, but it requires that the input be grouped by the key function, and it yields an iterable of items which is not the most convenient for recordsets. This here utility: - is exclusive to recordsets - returns a mapping of grouping keys to subsets of the input recordset - keeps the prefetching of the source recordset - allows grouping on a field, or an arbitrary (callable) key - should work even on "new records" (aka should be suitable for onchanges / arbitrary compute functions) While the method is RPC-compatible, it's not especially designed for that, it is likely a much better idea for the client to `read` the data they need then group that client side on whatever criteria they are interested in, or `read_group` the aggregated information they need directly if that's an option. Part-of: odoo/odoo#101522
…
…
Odoo
Odoo is a suite of web based open source business apps.
The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...
Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.
Getting started with Odoo
For a standard installation please follow the Setup instructions from the documentation.
To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials
Languages
Python
49.6%
JavaScript
47.8%
SCSS
2%
CSS
0.3%
HTML
0.2%