Merge lp:~camptocamp/banking-addons/bank-statement-reconcile-7.0-improv-controlling-jge into lp:banking-addons/bank-statement-reconcile-70

Proposed by Joël Grand-Guillaume @ camptocamp
Status: Merged
Approved by: Yannick Vaucher @ Camptocamp
Approved revision: 138
Merged at revision: 139
Proposed branch: lp:~camptocamp/banking-addons/bank-statement-reconcile-7.0-improv-controlling-jge
Merge into: lp:banking-addons/bank-statement-reconcile-70
Diff against target: 169 lines (+88/-8)
5 files modified
account_easy_reconcile/easy_reconcile.py (+53/-0)
account_easy_reconcile/easy_reconcile.xml (+10/-4)
account_statement_base_completion/statement.py (+7/-4)
account_statement_ext/__openerp__.py (+1/-0)
account_statement_ext/account_view.xml (+17/-0)
To merge this branch: bzr merge lp:~camptocamp/banking-addons/bank-statement-reconcile-7.0-improv-controlling-jge
Reviewer Review Type Date Requested Status
Yannick Vaucher @ Camptocamp code review, no test Approve
Leonardo Pistone code review Approve
Review via email: mp+209901@code.launchpad.net

Description of the change

Hi,

Those improvements mostely concerns various imrpovements to ease the controlling process:

  [IMP] Add buttons to open unreconciled and partially reconciled items from a profile to easy the verification and controlling
  [IMP] Add the number of lines in completion log to let the user know if some hasn't been auto-completed (e.g. 332/335 line compelted)
  [IMP] Add a group by bank statement in journal items search view to ease the reconciliation

To post a comment you must log in.
Revision history for this message
Leonardo Pistone (lepistone) wrote :

The code LGTM.

I would prefer to have one commit for each module, but I am not blocking because of that (I find it convenient to always use "bzr commit -i" from the interactive plugin, but maybe it is just because I miss "git add -p").

Thanks!

review: Approve (code review)
134. By Leonardo Pistone

[fix] account_statement_ext: trigger related fields

135. By Launchpad Translations on behalf of banking-addons-team

Launchpad automatic translations update.

136. By Joël Grand-Guillaume @ camptocamp

[IMP] Add buttons to open unreconciled and partially reconciled items from a profile to easy the verification and controlling

137. By Joël Grand-Guillaume @ camptocamp

[IMP] Add the number of lines in completion log to let the user know if some hasn't been auto-completed (e.g. 332/335 line compelted)

138. By Joël Grand-Guillaume @ camptocamp

[IMP] Add a group by bank statement in journal items search view to ease the reconciliation

Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

Each changes were splitted in different commits

Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

LGTM

review: Approve (code review, no test)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'account_easy_reconcile/easy_reconcile.py'
--- account_easy_reconcile/easy_reconcile.py 2013-02-13 15:54:48 +0000
+++ account_easy_reconcile/easy_reconcile.py 2014-03-14 10:52:25 +0000
@@ -22,6 +22,7 @@
22from openerp.osv import fields, osv, orm22from openerp.osv import fields, osv, orm
23from openerp.tools.translate import _23from openerp.tools.translate import _
24from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT24from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT
25from openerp.tools.translate import _
2526
2627
27class easy_reconcile_options(orm.AbstractModel):28class easy_reconcile_options(orm.AbstractModel):
@@ -257,6 +258,58 @@
257 _('Error'),258 _('Error'),
258 _('There is no history of reconciled '259 _('There is no history of reconciled '
259 'items on the task: %s.') % rec.name)260 'items on the task: %s.') % rec.name)
261
262 def _open_move_line_list(sefl, cr, uid, move_line_ids, name, context=None):
263 return {
264 'name': name,
265 'view_mode': 'tree,form',
266 'view_id': False,
267 'view_type': 'form',
268 'res_model': 'account.move.line',
269 'type': 'ir.actions.act_window',
270 'nodestroy': True,
271 'target': 'current',
272 'domain': unicode([('id', 'in', move_line_ids)]),
273 }
274
275 def open_unreconcile(self, cr, uid, ids, context=None):
276 """ Open the view of move line with the unreconciled move lines
277 """
278
279 assert len(ids) == 1 , \
280 "You can only open entries from one profile at a time"
281
282 obj_move_line = self.pool.get('account.move.line')
283 res = {}
284 for task in self.browse(cr, uid, ids, context=context):
285 line_ids = obj_move_line.search(
286 cr, uid,
287 [('account_id', '=', task.account.id),
288 ('reconcile_id', '=', False),
289 ('reconcile_partial_id', '=', False)],
290 context=context)
291
292 name = _('Unreconciled items')
293 return self._open_move_line_list(cr, uid, line_ids, name, context=context)
294
295 def open_partial_reconcile(self, cr, uid, ids, context=None):
296 """ Open the view of move line with the unreconciled move lines
297 """
298
299 assert len(ids) == 1 , \
300 "You can only open entries from one profile at a time"
301
302 obj_move_line = self.pool.get('account.move.line')
303 res = {}
304 for task in self.browse(cr, uid, ids, context=context):
305 line_ids = obj_move_line.search(
306 cr, uid,
307 [('account_id', '=', task.account.id),
308 ('reconcile_id', '=', False),
309 ('reconcile_partial_id', '!=', False)],
310 context=context)
311 name = _('Partial reconciled items')
312 return self._open_move_line_list(cr, uid, line_ids, name, context=context)
260313
261 def last_history_reconcile(self, cr, uid, rec_id, context=None):314 def last_history_reconcile(self, cr, uid, rec_id, context=None):
262 """ Get the last history record for this reconciliation profile315 """ Get the last history record for this reconciliation profile
263316
=== modified file 'account_easy_reconcile/easy_reconcile.xml'
--- account_easy_reconcile/easy_reconcile.xml 2013-02-13 15:54:48 +0000
+++ account_easy_reconcile/easy_reconcile.xml 2014-03-14 10:52:25 +0000
@@ -13,11 +13,9 @@
13 <button name="run_reconcile" class="oe_highlight"13 <button name="run_reconcile" class="oe_highlight"
14 string="Start Auto Reconciliation" type="object"/>14 string="Start Auto Reconciliation" type="object"/>
15 <button icon="STOCK_JUMP_TO" name="last_history_reconcile"15 <button icon="STOCK_JUMP_TO" name="last_history_reconcile"
16 class="oe_highlight"
17 string="Display items reconciled on the last run"16 string="Display items reconciled on the last run"
18 type="object"/>17 type="object"/>
19 <button icon="STOCK_JUMP_TO" name="last_history_partial"18 <button icon="STOCK_JUMP_TO" name="last_history_partial"
20 class="oe_highlight"
21 string="Display items partially reconciled on the last run"19 string="Display items partially reconciled on the last run"
22 type="object"/>20 type="object"/>
23 </header>21 </header>
@@ -30,8 +28,16 @@
30 <field name="company_id" groups="base.group_multi_company"/>28 <field name="company_id" groups="base.group_multi_company"/>
31 </group>29 </group>
32 <group>30 <group>
33 <field name="unreconciled_count"/>31 <group>
34 <field name="reconciled_partial_count"/>32 <field name="unreconciled_count"/>
33 <button icon="STOCK_JUMP_TO" name="open_unreconcile"
34 string="Go to unreconciled items" type="object"/>
35 </group>
36 <group>
37 <field name="reconciled_partial_count"/>
38 <button icon="STOCK_JUMP_TO" name="open_partial_reconcile"
39 string="Go to partial reconciled items" type="object"/>
40 </group>
35 </group>41 </group>
36 </group>42 </group>
37 <notebook colspan="4">43 <notebook colspan="4">
3844
=== modified file 'account_statement_base_completion/statement.py'
--- account_statement_base_completion/statement.py 2014-02-21 18:29:07 +0000
+++ account_statement_base_completion/statement.py 2014-03-14 10:52:25 +0000
@@ -496,18 +496,21 @@
496 """496 """
497 user_name = self.pool.get('res.users').read(cr, uid, uid,497 user_name = self.pool.get('res.users').read(cr, uid, uid,
498 ['name'], context=context)['name']498 ['name'], context=context)['name']
499 statement = self.browse(cr, uid, stat_id, context=context)
500 number_line = len(statement.line_ids)
499501
500 log = self.read(cr, uid, stat_id, ['completion_logs'],502 log = self.read(cr, uid, stat_id, ['completion_logs'],
501 context=context)['completion_logs']503 context=context)['completion_logs']
502 log = log if log else ""504 log = log if log else ""
503505
504 completion_date = datetime.datetime.now().strftime(DEFAULT_SERVER_DATETIME_FORMAT)506 completion_date = datetime.datetime.now().strftime(DEFAULT_SERVER_DATETIME_FORMAT)
505 message = (_("%s Bank Statement ID %s has %s lines completed by %s \n%s\n%s\n") %507 message = (_("%s Bank Statement ID %s has %s/%s lines completed by %s \n%s\n%s\n") %
506 (completion_date, stat_id, number_imported, user_name, error_msg, log))508 (completion_date, stat_id, number_imported, number_line, user_name,
509 error_msg, log))
507 self.write(cr, uid, [stat_id], {'completion_logs': message}, context=context)510 self.write(cr, uid, [stat_id], {'completion_logs': message}, context=context)
508511
509 body = (_('Statement ID %s auto-completed for %s lines completed') %512 body = (_('Statement ID %s auto-completed for %s/%s lines completed') %
510 (stat_id, number_imported)),513 (stat_id, number_imported, number_line)),
511 self.message_post(cr, uid,514 self.message_post(cr, uid,
512 [stat_id],515 [stat_id],
513 body=body,516 body=body,
514517
=== modified file 'account_statement_ext/__openerp__.py'
--- account_statement_ext/__openerp__.py 2014-03-12 15:20:42 +0000
+++ account_statement_ext/__openerp__.py 2014-03-14 10:52:25 +0000
@@ -74,6 +74,7 @@
74 """,74 """,
75 'website': 'http://www.camptocamp.com',75 'website': 'http://www.camptocamp.com',
76 'data': ['statement_view.xml',76 'data': ['statement_view.xml',
77 'account_view.xml',
77 'report/bank_statement_webkit_header.xml',78 'report/bank_statement_webkit_header.xml',
78 'report.xml',79 'report.xml',
79 'security/ir.model.access.csv',80 'security/ir.model.access.csv',
8081
=== added file 'account_statement_ext/account_view.xml'
--- account_statement_ext/account_view.xml 1970-01-01 00:00:00 +0000
+++ account_statement_ext/account_view.xml 2014-03-14 10:52:25 +0000
@@ -0,0 +1,17 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4
5 <record id="view_account_move_line_filter_add_statement" model="ir.ui.view">
6 <field name="name">Journal Items add statement</field>
7 <field name="model">account.move.line</field>
8 <field name="inherit_id" ref="account.view_account_move_line_filter"/>
9 <field name="arch" type="xml">
10 <xpath expr="/search/group/filter[@string='Period']" position="after">
11 <filter string="Bank Statement" context="{'group_by': 'statement_id'}" icon="terp-partner"/>
12 </xpath>
13 </field>
14 </record>
15
16 </data>
17</openerp>

Subscribers

People subscribed via source and target branches