[IMP] mail: improve field tracking #41554
seb-odoo left a comment
Nothing really bad caught my attention, but the code was a bit tricky to understand I felt.
This also fixes task 2006854 so that's good.
It's still very inconsistent with translations however, but I guess this is outside the scope of this PR?
I have not tested monetary that we know isn't logical with currencies, but also outside the scope I assume.
Maybe it would be nice to add a warning when trying to track a field type that is not supported (m2m, ...).
Also delay the tracking until the call to flush(), so that several updates on a record generate a single tracking message.
In order to count queries exactly, the warmup phase of a test method (decorator `@warmup`) must do the exact same operations as the normal phase.