[FIX] mail: _finalize_tracking was not properly flushed

Before this commit, no recompulation were performed at the end of the
tracking procedure.  This is because the main flush() occurred before
the tracking of values.  The absence of flushing is problematic in the
case where the tracking is used to create/update records.

closes odoo/odoo#44851

X-original-commit: c60da49a1d81fa73b60135185d5b706eec771475
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
This commit is contained in:
Arnaud Joset
2020-02-07 12:43:44 +00:00
committed by Raphael Collet
parent ef03b02af6
commit a98f0af9e2
+3
View File
@@ -467,6 +467,9 @@ class MailThread(models.AbstractModel):
for record in records:
changes, tracking_value_ids = tracking.get(record.id, (None, None))
record._message_track_post_template(changes)
# this method is called after the main flush() and just before commit();
# we have to flush() again in case we triggered some recomputations
self.flush()
def with_lang(self):
if not self._context.get("lang"):