From ef0d203250c903981b2740fd8afc630b3e99a2d7 Mon Sep 17 00:00:00 2001 From: Artem Kostyuk Date: Wed, 24 Oct 2018 12:50:11 +0300 Subject: [PATCH] [DOC] Reason usage of explicit `self.env.cr.commit()`-s --- account_move_batch_validate/models/account_move.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/account_move_batch_validate/models/account_move.py b/account_move_batch_validate/models/account_move.py index 94be0a2f7..c71970bad 100644 --- a/account_move_batch_validate/models/account_move.py +++ b/account_move_batch_validate/models/account_move.py @@ -54,6 +54,8 @@ class AccountMove(models.Model): move.id) values['post_job_uuid'] = new_job.uuid move.write(values) + # Explicit committing is done for the capability of tracking + # created jobs in live, during creation process self.env.cr.commit() # pylint:disable=invalid-commit @api.model @@ -91,6 +93,8 @@ class AccountMove(models.Model): for index in range(0, moves_count, BLOCK_SIZE): moves = self[index:index + BLOCK_SIZE] moves.write(values) + # Explicit committing is done for the capability of tracking + # created jobs in live, during creation process # users like to see the flag sooner rather than later self.env.cr.commit() # pylint:disable=invalid-commit self._delay_post_marked(eta=eta)