mirror of
https://github.com/OCA/account-reconcile.git
synced 2025-01-20 12:27:39 +02:00
[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
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
|
||||
{
|
||||
"name": "Easy Reconcile",
|
||||
"version": "1.3.0",
|
||||
"version": "1.3.1",
|
||||
"depends": ["account"],
|
||||
"author": "Akretion,Camptocamp",
|
||||
"description": """
|
||||
|
||||
@@ -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 @@ class account_easy_reconcile(orm.Model):
|
||||
_('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
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
##############################################################################
|
||||
|
||||
{'name': "Bank statement base completion",
|
||||
'version': '1.0.1',
|
||||
'version': '1.0.2',
|
||||
'author': 'Camptocamp',
|
||||
'maintainer': 'Camptocamp',
|
||||
'category': 'Finance',
|
||||
|
||||
@@ -496,18 +496,21 @@ class AccountBankStatement(orm.Model):
|
||||
"""
|
||||
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,
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
##############################################################################
|
||||
|
||||
{'name': "Bank statement extension and profiles",
|
||||
'version': '1.3.4',
|
||||
'version': '1.3.5',
|
||||
'author': 'Camptocamp',
|
||||
'maintainer': 'Camptocamp',
|
||||
'category': 'Finance',
|
||||
@@ -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',
|
||||
|
||||
17
account_statement_ext/account_view.xml
Normal file
17
account_statement_ext/account_view.xml
Normal file
@@ -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>
|
||||
Reference in New Issue
Block a user