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
=== modified file 'account_move_batch_validate/account.py'
--- account_move_batch_validate/account.py 2014-02-21 13:44:05 +0000
+++ account_move_batch_validate/account.py 2014-02-27 09:56:03 +0000
@@ -20,6 +20,8 @@
20###############################################################################20###############################################################################
21"""Accounting customisation for delayed posting."""21"""Accounting customisation for delayed posting."""
2222
23import logging
24
23from openerp.osv import fields, orm25from openerp.osv import fields, orm
24from openerp.tools.translate import _26from openerp.tools.translate import _
2527
@@ -27,6 +29,8 @@
27from openerp.addons.connector.session import ConnectorSession29from openerp.addons.connector.session import ConnectorSession
28from openerp.addons.connector.queue.job import OpenERPJobStorage30from openerp.addons.connector.queue.job import OpenERPJobStorage
2931
32_logger = logging.getLogger(__name__)
33
30# do a massive write on account moves BLOCK_SIZE at a time34# do a massive write on account moves BLOCK_SIZE at a time
31BLOCK_SIZE = 100035BLOCK_SIZE = 1000
3236
@@ -67,6 +71,12 @@
67 ('state', '=', 'draft'),71 ('state', '=', 'draft'),
68 ], context=context)72 ], context=context)
6973
74 _logger.info(
75 u'{0} jobs for posting moves have been created.'.format(
76 len(move_ids)
77 )
78 )
79
70 for move_id in move_ids:80 for move_id in move_ids:
71 job_uuid = validate_one_move.delay(session, self._name, move_id,81 job_uuid = validate_one_move.delay(session, self._name, move_id,
72 eta=eta)82 eta=eta)
@@ -107,6 +117,11 @@
107 context = {}117 context = {}
108 # For massive amounts of moves, this becomes necessary to avoid118 # For massive amounts of moves, this becomes necessary to avoid
109 # MemoryError's119 # MemoryError's
120
121 _logger.info(
122 u'{0} moves marked for posting.'.format(len(move_ids))
123 )
124
110 for start in xrange(0, len(move_ids), BLOCK_SIZE):125 for start in xrange(0, len(move_ids), BLOCK_SIZE):
111 self.write(126 self.write(
112 cr,127 cr,

Subscribers

People subscribed via source and target branches