From bf093ee617fe6c2cadf7ae9ed63c42c5206727be Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Thu, 22 Nov 2012 10:23:02 +0100 Subject: [PATCH] [ADD]Reconcile function which return the full or partial reconcile depending on which is setted for the move line bzr revid: dle@openerp.com-20121122092302-rji8z8bgbb3p8k14 --- addons/account/account_move_line.py | 10 ++++++++++ addons/account/account_view.xml | 5 ++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 9a67a3c9b19..bbdf2468010 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -477,6 +477,15 @@ class account_move_line(osv.osv): result.append(line.id) return result + def _get_reconcile(self, cr, uid, ids,name, unknow_none, context=None): + res = dict.fromkeys(ids, False) + for line in self.browse(cr, uid, ids, context=context): + if line.reconcile_id: + res[line.id] = str(line.reconcile_id.name) + elif line.reconcile_partial_id: + res[line.id] = str(line.reconcile_partial_id.name) + return res + _columns = { 'name': fields.char('Name', size=64, required=True), 'quantity': fields.float('Quantity', digits=(16,2), help="The optional quantity expressed by this line, eg: number of product sold. The quantity is not a legal requirement but is very useful for some reports."), @@ -491,6 +500,7 @@ class account_move_line(osv.osv): 'statement_id': fields.many2one('account.bank.statement', 'Statement', help="The bank statement used for bank reconciliation", select=1), 'reconcile_id': fields.many2one('account.move.reconcile', 'Reconcile', readonly=True, ondelete='set null', select=2), 'reconcile_partial_id': fields.many2one('account.move.reconcile', 'Partial Reconcile', readonly=True, ondelete='set null', select=2), + 'reconcile': fields.function(_get_reconcile, type='char', string='Reconcile'), 'amount_currency': fields.float('Amount Currency', help="The amount expressed in an optional other currency if it is a multi-currency entry.", digits_compute=dp.get_precision('Account')), 'amount_residual_currency': fields.function(_amount_residual, string='Residual Amount', multi="residual", help="The residual amount on a receivable or payable of a journal entry expressed in its currency (maybe different of the company currency)."), 'amount_residual': fields.function(_amount_residual, string='Residual Amount', multi="residual", help="The residual amount on a receivable or payable of a journal entry expressed in the company currency."), diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 19e0f22162c..c9c95cd8d69 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -1003,8 +1003,7 @@ - - + @@ -1183,7 +1182,7 @@

- Click to register a new journal item. + Select the period and the journal you want to fill.

This view can be used by accountants in order to quickly record entries in OpenERP. If you want to record a supplier invoice,