Files
odoo_source/odoo
Denis Ledoux 394642e1dc [FIX] base: do not recompute res.users.share on add/remove multi-company
This is a performance patch.

Writing on the field `users` of `res.groups` had the side effect
to recompute the field `share` of `res.users`.

This is because the trigger of this field is
`@api.depends('groups_id')`.

The more users you had, the more time it took to
add or remove the second company of a user.

This also slowed down the creation of employee users
when the multi-company group was added
to the inherited groups of the employee group
(basically when checking "Multi-Company" in the General Settings)
as then all new employee matched the condition
`if len(user.company_ids) <= 1 and user.id in group_multi_company.users.ids:`
(Multi-Company group checked, but only one company set, by default).

closes odoo/odoo#33305

Signed-off-by: Denis Ledoux <beledouxdenis@users.noreply.github.com>
2019-05-10 15:43:46 +00:00
..
2018-10-24 16:15:02 +02:00
…
…
…
…
…