Files
odoo_source/addons/hr/static
Alexandre Kühn a479a0bba6 [FIX] hr, mail: no crash on empty member.persona
Steps to reproduce:
- install `hr_homeworking`
- connect as Mitchell Admin
- make a private chat with Marc Demo
- `@mention` Marc Demo
=> crash (cannot read name of undefined (reading persona))

This happens because a spread record was inserted in model,
and in this scenario the record list in data can be the exact same
as the record list used in the model. The internal code of assigning
a many list is to `clear()` and then `push()` from data, but if the
data mutates from the `clear()`, then the `push()` does nothing and
the resulting relation is emptied.

This commit fixes the issue by keeping a copy of collection before
`clear()` so that push applies on original data that is intended by
insert.

This commit also adapt code in hr to not use spread record to insert
Persona. While it works with the fix, it's simpler to just update the
appropriate field and also more efficient, because spread a record
has to process all fields as an insert, wasting CPU time.

closes odoo/odoo#139143

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-10-19 17:01:15 +00:00
..
2023-10-16 09:21:17 +00:00
…
…