Merge lp:~camptocamp/account-financial-tools/7.0-batch-validate-log-more-lep into lp:~account-core-editors/account-financial-tools/7.0

Proposed by Leonardo Pistone
Status: Merged
Merged at revision: 161
Proposed branch: lp:~camptocamp/account-financial-tools/7.0-batch-validate-log-more-lep
Merge into: lp:~account-core-editors/account-financial-tools/7.0
Diff against target: 46 lines (+15/-0)
1 file modified
account_move_batch_validate/account.py (+15/-0)
To merge this branch: bzr merge lp:~camptocamp/account-financial-tools/7.0-batch-validate-log-more-lep
Reviewer Review Type Date Requested Status
Nicolas Bessi - Camptocamp (community) no test, code review Approve
Guewen Baconnier @ Camptocamp code review Approve
Pedro Manuel Baeza code review Approve
Review via email: mp+208420@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Hi, Leonardo, I think it's better a more neutral language on logging messages. Could you put something like "{0} jobs for posting moves will be created"?

Regards.

review: Needs Fixing (code review)
162. By Leonardo Pistone

[imp] account_move_batch_validate: impersonal log messages

Revision history for this message
Leonardo Pistone (lepistone) wrote :

There you are Pedro.

Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Thank you very much, Leonardo.

Regards.

review: Approve (code review)
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

LGTM

review: Approve (code review)
Revision history for this message
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote :

LGTM

review: Approve (no test, code review)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_move_batch_validate/account.py'
2--- account_move_batch_validate/account.py 2014-02-21 13:44:05 +0000
3+++ account_move_batch_validate/account.py 2014-02-27 09:56:03 +0000
4@@ -20,6 +20,8 @@
5 ###############################################################################
6 """Accounting customisation for delayed posting."""
7
8+import logging
9+
10 from openerp.osv import fields, orm
11 from openerp.tools.translate import _
12
13@@ -27,6 +29,8 @@
14 from openerp.addons.connector.session import ConnectorSession
15 from openerp.addons.connector.queue.job import OpenERPJobStorage
16
17+_logger = logging.getLogger(__name__)
18+
19 # do a massive write on account moves BLOCK_SIZE at a time
20 BLOCK_SIZE = 1000
21
22@@ -67,6 +71,12 @@
23 ('state', '=', 'draft'),
24 ], context=context)
25
26+ _logger.info(
27+ u'{0} jobs for posting moves have been created.'.format(
28+ len(move_ids)
29+ )
30+ )
31+
32 for move_id in move_ids:
33 job_uuid = validate_one_move.delay(session, self._name, move_id,
34 eta=eta)
35@@ -107,6 +117,11 @@
36 context = {}
37 # For massive amounts of moves, this becomes necessary to avoid
38 # MemoryError's
39+
40+ _logger.info(
41+ u'{0} moves marked for posting.'.format(len(move_ids))
42+ )
43+
44 for start in xrange(0, len(move_ids), BLOCK_SIZE):
45 self.write(
46 cr,

Subscribers

People subscribed via source and target branches