With this commit, it is now possible to group the records of a model by a Many2many field of said model. The result of a read_group grouped by a m2m will return as many entries or "groups" as there are different records in the comodel that are linked to the model through the m2m, plus a null/false group, for records of the model that have no linked records of the comodel or for records of the comodel for which the current user has no read access to due to ir.rules. For a more illustrated explanation, the tests should cover all cases in detail. Note that this commit only introduces this change at the ORM level, the frontend does not yet handle grouping by m2m fields but it is planned in the near future. Task-2428971 closes odoo/odoo#68958 Signed-off-by: Raphael Collet (rco) <rco@openerp.com> Co-authored-by: Raphael Collet <rco@odoo.com>
1.0 KiB
1.0 KiB
| 1 | id | name | model_id:id | group_id:id | perm_read | perm_write | perm_create | perm_unlink |
|---|---|---|---|---|---|---|---|---|
| 2 | access_test_read_group_on_date | access_test_read_group_on_date | model_test_read_group_on_date | 1 | 0 | 0 | 0 | |
| 3 | access_test_read_group_aggregate_boolean | access_test_read_group_aggregate_boolean | model_test_read_group_aggregate_boolean | 1 | 0 | 0 | 0 | |
| 4 | access_test_read_group_aggregate | access_test_read_group_aggregate | model_test_read_group_aggregate | 1 | 0 | 0 | 0 | |
| 5 | access_test_read_group_on_selection | access_test_read_group_on_selection | model_test_read_group_on_selection | 1 | 0 | 0 | 0 | |
| 6 | access_test_read_group_fill_temporal | access_test_read_group_fill_temporal | model_test_read_group_fill_temporal | 1 | 0 | 0 | 0 | |
| 7 | access_test_read_group_order | access_test_read_group_order | model_test_read_group_order | 1 | 0 | 0 | 0 | |
| 8 | access_test_read_group_order_line | access_test_read_group_order_line | model_test_read_group_order_line | 1 | 0 | 0 | 0 | |
| 9 | access_test_read_group_user | access_test_read_group_user | model_test_read_group_user | 1 | 0 | 0 | 0 | |
| 10 | access_test_read_group_task | access_test_read_group_task | model_test_read_group_task | 1 | 0 | 0 | 0 |