Files
odoo_source/addons/web
Bruno Boi cbc9f3c649 [IMP] web: support many2many grouping
PURPOSE

Allow to group records by many2many fields.

Use case: turn the user_id m2o field on project.task into a user_ids m2m field
in order to assign multiple collaborators on a task

SPECIFICATION

Add many2many fields to the 'list of groupable fields'.
When grouping a set of records by a many2many, records linked to multiple
records of the comodel will essentially be in multiple 'groups' (even though
those are not really 'groups' anymore).
There will also be a "null" group, for records that have an empty value of the
many2many, like "unassigned" records.

Example: grouping a project.task linked to 10 res.users by the user_ids
many2many field, the project.task will be 'rendered/considered/displayed' 10
times, once per res.users.
Kind of like if we grouped the m2m relation table instead.

When grouping by a m2m field:
- listview
    editing an instance of a record also updates each other instance(if any)
        - the same goes when scheduling an activity, etc.
    disable deletion
        - the risk here is that the user might expected that this will 'unlike'
        the record from a specific record of the many2many field
    disable archive/unarchive
- kanban
    disable drag&drop between groups
    disable deletion
    disable archive/unarchive
- searchview
    display many2many fields custom groupby dropdown

With this commit, we also support groupby many2many field in mockServer so that
test cases are written based on that.

task-2508608

closes odoo/odoo#74985

Related: odoo/enterprise#20192
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2021-08-26 16:24:59 +00:00
..
…
…