← Back to team overview

banking-addons-team team mailing list archive

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

 

Joël Grand-Guillaume @ camptocamp has proposed merging lp:~camptocamp/banking-addons/bank-statement-reconcile-7.0-improv-controlling-jge into lp:banking-addons/bank-statement-reconcile-7.0.

Requested reviews:
  Banking Addons Core Editors (banking-addons-team)

For more details, see:
https://code.launchpad.net/~camptocamp/banking-addons/bank-statement-reconcile-7.0-improv-controlling-jge/+merge/209901

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


-- 
https://code.launchpad.net/~camptocamp/banking-addons/bank-statement-reconcile-7.0-improv-controlling-jge/+merge/209901
Your team Banking Addons Core Editors is requested to review the proposed merge of lp:~camptocamp/banking-addons/bank-statement-reconcile-7.0-improv-controlling-jge into lp:banking-addons/bank-statement-reconcile-7.0.
=== 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-07 11:57:23 +0000
@@ -22,6 +22,7 @@
 from openerp.osv import fields, osv, orm
 from openerp.tools.translate import _
 from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT
+from openerp.tools.translate import _
 
 
 class easy_reconcile_options(orm.AbstractModel):
@@ -257,6 +258,58 @@
                 _('Error'),
                 _('There is no history of reconciled '
                   'items on the task: %s.') % rec.name)
+     
+    def _open_move_line_list(sefl, cr, uid, move_line_ids, name, context=None):
+        return {
+            'name': name,
+            'view_mode': 'tree,form',
+            'view_id': False,
+            'view_type': 'form',
+            'res_model': 'account.move.line',
+            'type': 'ir.actions.act_window',
+            'nodestroy': True,
+            'target': 'current',
+            'domain': unicode([('id', 'in', move_line_ids)]),
+            }
+
+    def open_unreconcile(self, cr, uid, ids, context=None):
+        """ Open the view of move line with the unreconciled move lines
+        """
+
+        assert len(ids) == 1 , \
+                "You can only open entries from one profile at a time"
+
+        obj_move_line = self.pool.get('account.move.line')
+        res = {}
+        for task in self.browse(cr, uid, ids, context=context):
+             line_ids = obj_move_line.search(
+                cr, uid,
+                [('account_id', '=', task.account.id),
+                 ('reconcile_id', '=', False),
+                 ('reconcile_partial_id', '=', False)],
+                context=context)
+
+        name = _('Unreconciled items')
+        return self._open_move_line_list(cr, uid, line_ids, name, context=context)
+
+    def open_partial_reconcile(self, cr, uid, ids, context=None):
+        """ Open the view of move line with the unreconciled move lines
+        """
+
+        assert len(ids) == 1 , \
+                "You can only open entries from one profile at a time"
+
+        obj_move_line = self.pool.get('account.move.line')
+        res = {}
+        for task in self.browse(cr, uid, ids, context=context):
+             line_ids = obj_move_line.search(
+                cr, uid,
+                [('account_id', '=', task.account.id),
+                 ('reconcile_id', '=', False),
+                 ('reconcile_partial_id', '!=', False)],
+                context=context)
+        name = _('Partial reconciled items')
+        return self._open_move_line_list(cr, uid, line_ids, name, context=context)
 
     def last_history_reconcile(self, cr, uid, rec_id, context=None):
         """ Get the last history record for this reconciliation profile

=== 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-07 11:57:23 +0000
@@ -13,11 +13,9 @@
                     <button name="run_reconcile" class="oe_highlight"
                         string="Start Auto Reconciliation" type="object"/>
                     <button icon="STOCK_JUMP_TO" name="last_history_reconcile"
-                        class="oe_highlight"
                         string="Display items reconciled on the last run"
                         type="object"/>
                     <button icon="STOCK_JUMP_TO" name="last_history_partial"
-                        class="oe_highlight"
                         string="Display items partially reconciled on the last run"
                         type="object"/>
                 </header>
@@ -30,8 +28,16 @@
                             <field name="company_id" groups="base.group_multi_company"/>
                         </group>
                         <group>
-                            <field name="unreconciled_count"/>
-                            <field name="reconciled_partial_count"/>
+                            <group>
+                                <field name="unreconciled_count"/>
+                                <button icon="STOCK_JUMP_TO" name="open_unreconcile"
+                                        string="Go to unreconciled items" type="object"/>
+                            </group>
+                            <group>
+                                <field name="reconciled_partial_count"/>
+                                <button icon="STOCK_JUMP_TO" name="open_partial_reconcile"
+                                        string="Go to partial reconciled items" type="object"/>
+                            </group>
                         </group>
                     </group>
                     <notebook colspan="4">

=== 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-07 11:57:23 +0000
@@ -496,18 +496,21 @@
         """
         user_name = self.pool.get('res.users').read(cr, uid, uid,
                                                     ['name'], context=context)['name']
+        statement = self.browse(cr, uid, stat_id, context=context)
+        number_line = len(statement.line_ids)
 
         log = self.read(cr, uid, stat_id, ['completion_logs'],
                         context=context)['completion_logs']
         log = log if log else ""
 
         completion_date = datetime.datetime.now().strftime(DEFAULT_SERVER_DATETIME_FORMAT)
-        message = (_("%s Bank Statement ID %s has %s lines completed by %s \n%s\n%s\n") %
-                   (completion_date, stat_id, number_imported, user_name, error_msg, log))
+        message = (_("%s Bank Statement ID %s has %s/%s lines completed by %s \n%s\n%s\n") %
+                   (completion_date, stat_id, number_imported, number_line, user_name, 
+                    error_msg, log))
         self.write(cr, uid, [stat_id], {'completion_logs': message}, context=context)
 
-        body = (_('Statement ID %s auto-completed for %s lines completed') %
-                (stat_id, number_imported)),
+        body = (_('Statement ID %s auto-completed for %s/%s lines completed') %
+                (stat_id, number_imported, number_line)),
         self.message_post(cr, uid,
                           [stat_id],
                           body=body,

=== modified file 'account_statement_ext/__openerp__.py'
--- account_statement_ext/__openerp__.py	2014-03-06 10:48:37 +0000
+++ account_statement_ext/__openerp__.py	2014-03-07 11:57:23 +0000
@@ -74,6 +74,7 @@
  """,
  'website': 'http://www.camptocamp.com',
  'data': ['statement_view.xml',
+          'account_view.xml',
           'report/bank_statement_webkit_header.xml',
           'report.xml',
           'security/ir.model.access.csv',

=== 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-07 11:57:23 +0000
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+
+    <record id="view_account_move_line_filter_add_statement" model="ir.ui.view">
+        <field name="name">Journal Items add statement</field>
+        <field name="model">account.move.line</field>
+        <field name="inherit_id" ref="account.view_account_move_line_filter"/>
+        <field name="arch" type="xml">
+            <xpath expr="/search/group/filter[@string='Period']" position="after">
+                <filter string="Bank Statement" context="{'group_by': 'statement_id'}" icon="terp-partner"/>
+            </xpath>
+        </field>
+    </record>
+
+    </data>
+</openerp>


Follow ups