This module adds a partition(self, accessor) method to every model. It accepts for accessor any parameter that would be accepted by mapped, i.e. a string "field(.subfield)*" or a function (lambda x: not x.b). It returns a dictionary with keys that are equal to set(record.mapped(accessor)), and with values that are recordsets (these recordsets forming a partition of the initial recordset, conveniently).
So if we have a recordset (x \| y \| z ) such that x.f == True, y.f == z.f == False, then (x \| y \| z ).partition("f") == {True: x, False: (y \| z)}.
auto_awesome What this module does
AI-generated from the code · Odoo 19.0Adds three helper methods to every Odoo model so developers can group records by a value, split them into smaller chunks, and read data record by record. These are technical tools used by other modules, not new screens for end users.
This is a technical base module. It does not add menus, buttons or reports, and it does not change what users see on screen. Instead, it extends the shared base model so that every model in Odoo gains three extra methods that other modules can call.
partition: groups a set of records into a dictionary, where each key is a value taken from the records and each value is the group of records sharing that value. The value can be read from a field name, a path such as a field followed by a subfield, or a custom function. If a value cannot be used as a dictionary key, its text form is used instead.batch: splits a set of records into successive smaller groups of a chosen size, which is useful to process large amounts of data without loading everything at once. If no size is given, the model must define a default batch size, otherwise an error message is shown asking for one.read_per_record: reads the requested fields and returns the data as a dictionary keyed by record identifier instead of a plain list.
Because it touches the base model, these methods are available on all Odoo models. The module depends only on base and adds no data, views or configuration.
Depends on
Required by other modules
Models and fields (1)
- base · extends an existing model
Text generated by AI (DeepSeek) from reading the Odoo 19.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub
Availability by version
Reviewed: 2026-11-03Confirmation status: 4 confirmed, 5 with no information of 9 versions.
Sources · Odoo 17.0
Confirmed on 2026-11-03 in branch 17.0 of OCA/server-tools.
terminal Installation and usage
No verified informationInstallation instructions, the distribution package, dependencies and configuration steps are not shown because they have not yet been verified in the module documentation for any version.
Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.