Tuesday, December 21, 2021
2 changes · master
Resolved issues and error corrections
Creating multiple records that use the mail chatter now adds followers in a single batch instead of one at a time. This reduces processing time and database work during imports and other bulk creation flows, while preserving existing follower behavior.
Original PR description
The `_insert_followers` wasn't batch in the `create` of `mail.thread` for no reason, which call the create of a `mail.follower` one by one. It is inefficient for the batch records creation (import or some flows) of a model with `_inherit = [mail.thread, ...]`. Then batch it, to miminize the cost of `_insert_followers`: The creation of 100 `mail.follower` takes: - 0.107 sec if you create one by one (before) - 0.022 sec if you create in batch (now)
This fix restores a mail preference that was removed by mistake but was still needed by the system. It helps ensure users' notification volume settings continue to work as expected.
Original PR description
Follow-up of https://github.com/odoo/odoo/pull/81679 This field was actually being used, so shouldn't have been deleted.