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
1=== modified file 'account_easy_reconcile/easy_reconcile.py'
2--- account_easy_reconcile/easy_reconcile.py 2013-02-13 15:54:48 +0000
3+++ account_easy_reconcile/easy_reconcile.py 2014-03-14 10:52:25 +0000
4@@ -22,6 +22,7 @@
5 from openerp.osv import fields, osv, orm
6 from openerp.tools.translate import _
7 from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT
8+from openerp.tools.translate import _
9
10
11 class easy_reconcile_options(orm.AbstractModel):
12@@ -257,6 +258,58 @@
13 _('Error'),
14 _('There is no history of reconciled '
15 'items on the task: %s.') % rec.name)
16+
17+ def _open_move_line_list(sefl, cr, uid, move_line_ids, name, context=None):
18+ return {
19+ 'name': name,
20+ 'view_mode': 'tree,form',
21+ 'view_id': False,
22+ 'view_type': 'form',
23+ 'res_model': 'account.move.line',
24+ 'type': 'ir.actions.act_window',
25+ 'nodestroy': True,
26+ 'target': 'current',
27+ 'domain': unicode([('id', 'in', move_line_ids)]),
28+ }
29+
30+ def open_unreconcile(self, cr, uid, ids, context=None):
31+ """ Open the view of move line with the unreconciled move lines
32+ """
33+
34+ assert len(ids) == 1 , \
35+ "You can only open entries from one profile at a time"
36+
37+ obj_move_line = self.pool.get('account.move.line')
38+ res = {}
39+ for task in self.browse(cr, uid, ids, context=context):
40+ line_ids = obj_move_line.search(
41+ cr, uid,
42+ [('account_id', '=', task.account.id),
43+ ('reconcile_id', '=', False),
44+ ('reconcile_partial_id', '=', False)],
45+ context=context)
46+
47+ name = _('Unreconciled items')
48+ return self._open_move_line_list(cr, uid, line_ids, name, context=context)
49+
50+ def open_partial_reconcile(self, cr, uid, ids, context=None):
51+ """ Open the view of move line with the unreconciled move lines
52+ """
53+
54+ assert len(ids) == 1 , \
55+ "You can only open entries from one profile at a time"
56+
57+ obj_move_line = self.pool.get('account.move.line')
58+ res = {}
59+ for task in self.browse(cr, uid, ids, context=context):
60+ line_ids = obj_move_line.search(
61+ cr, uid,
62+ [('account_id', '=', task.account.id),
63+ ('reconcile_id', '=', False),
64+ ('reconcile_partial_id', '!=', False)],
65+ context=context)
66+ name = _('Partial reconciled items')
67+ return self._open_move_line_list(cr, uid, line_ids, name, context=context)
68
69 def last_history_reconcile(self, cr, uid, rec_id, context=None):
70 """ Get the last history record for this reconciliation profile
71
72=== modified file 'account_easy_reconcile/easy_reconcile.xml'
73--- account_easy_reconcile/easy_reconcile.xml 2013-02-13 15:54:48 +0000
74+++ account_easy_reconcile/easy_reconcile.xml 2014-03-14 10:52:25 +0000
75@@ -13,11 +13,9 @@
76 <button name="run_reconcile" class="oe_highlight"
77 string="Start Auto Reconciliation" type="object"/>
78 <button icon="STOCK_JUMP_TO" name="last_history_reconcile"
79- class="oe_highlight"
80 string="Display items reconciled on the last run"
81 type="object"/>
82 <button icon="STOCK_JUMP_TO" name="last_history_partial"
83- class="oe_highlight"
84 string="Display items partially reconciled on the last run"
85 type="object"/>
86 </header>
87@@ -30,8 +28,16 @@
88 <field name="company_id" groups="base.group_multi_company"/>
89 </group>
90 <group>
91- <field name="unreconciled_count"/>
92- <field name="reconciled_partial_count"/>
93+ <group>
94+ <field name="unreconciled_count"/>
95+ <button icon="STOCK_JUMP_TO" name="open_unreconcile"
96+ string="Go to unreconciled items" type="object"/>
97+ </group>
98+ <group>
99+ <field name="reconciled_partial_count"/>
100+ <button icon="STOCK_JUMP_TO" name="open_partial_reconcile"
101+ string="Go to partial reconciled items" type="object"/>
102+ </group>
103 </group>
104 </group>
105 <notebook colspan="4">
106
107=== modified file 'account_statement_base_completion/statement.py'
108--- account_statement_base_completion/statement.py 2014-02-21 18:29:07 +0000
109+++ account_statement_base_completion/statement.py 2014-03-14 10:52:25 +0000
110@@ -496,18 +496,21 @@
111 """
112 user_name = self.pool.get('res.users').read(cr, uid, uid,
113 ['name'], context=context)['name']
114+ statement = self.browse(cr, uid, stat_id, context=context)
115+ number_line = len(statement.line_ids)
116
117 log = self.read(cr, uid, stat_id, ['completion_logs'],
118 context=context)['completion_logs']
119 log = log if log else ""
120
121 completion_date = datetime.datetime.now().strftime(DEFAULT_SERVER_DATETIME_FORMAT)
122- message = (_("%s Bank Statement ID %s has %s lines completed by %s \n%s\n%s\n") %
123- (completion_date, stat_id, number_imported, user_name, error_msg, log))
124+ message = (_("%s Bank Statement ID %s has %s/%s lines completed by %s \n%s\n%s\n") %
125+ (completion_date, stat_id, number_imported, number_line, user_name,
126+ error_msg, log))
127 self.write(cr, uid, [stat_id], {'completion_logs': message}, context=context)
128
129- body = (_('Statement ID %s auto-completed for %s lines completed') %
130- (stat_id, number_imported)),
131+ body = (_('Statement ID %s auto-completed for %s/%s lines completed') %
132+ (stat_id, number_imported, number_line)),
133 self.message_post(cr, uid,
134 [stat_id],
135 body=body,
136
137=== modified file 'account_statement_ext/__openerp__.py'
138--- account_statement_ext/__openerp__.py 2014-03-12 15:20:42 +0000
139+++ account_statement_ext/__openerp__.py 2014-03-14 10:52:25 +0000
140@@ -74,6 +74,7 @@
141 """,
142 'website': 'http://www.camptocamp.com',
143 'data': ['statement_view.xml',
144+ 'account_view.xml',
145 'report/bank_statement_webkit_header.xml',
146 'report.xml',
147 'security/ir.model.access.csv',
148
149=== added file 'account_statement_ext/account_view.xml'
150--- account_statement_ext/account_view.xml 1970-01-01 00:00:00 +0000
151+++ account_statement_ext/account_view.xml 2014-03-14 10:52:25 +0000
152@@ -0,0 +1,17 @@
153+<?xml version="1.0" encoding="utf-8"?>
154+<openerp>
155+ <data>
156+
157+ <record id="view_account_move_line_filter_add_statement" model="ir.ui.view">
158+ <field name="name">Journal Items add statement</field>
159+ <field name="model">account.move.line</field>
160+ <field name="inherit_id" ref="account.view_account_move_line_filter"/>
161+ <field name="arch" type="xml">
162+ <xpath expr="/search/group/filter[@string='Period']" position="after">
163+ <filter string="Bank Statement" context="{'group_by': 'statement_id'}" icon="terp-partner"/>
164+ </xpath>
165+ </field>
166+ </record>
167+
168+ </data>
169+</openerp>

Subscribers

People subscribed via source and target branches