From 002f6aa7c1c31df7dc4a8459e3a5200bc9a723c9 Mon Sep 17 00:00:00 2001 From: Chris Biersbach Date: Tue, 26 Mar 2013 10:34:13 +0100 Subject: [PATCH] [FIX] account_move_line: takes into account the ir_rules when listing the partenrs to reconcile bzr revid: cbi@openerp.com-20130326093413-j0e8hpb0eqig1too --- addons/account/account_move_line.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 2d03ea8921a..082d654c5a2 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -753,9 +753,14 @@ class account_move_line(osv.osv): ) AS s WHERE debit > 0 AND credit > 0 AND (last_reconciliation_date IS NULL OR max_date > last_reconciliation_date) ORDER BY last_reconciliation_date""") - ids = cr.fetchall() - ids = len(ids) and [x[0] for x in ids] or [] - return self.pool.get('res.partner').name_get(cr, uid, ids, context=context) + ids = [x[0] for x in cr.fetchall()] + if not ids: + return [] + + # To apply the ir_rules + partner_obj = self.pool.get('res.partner') + ids = partner_obj.search(cr, uid, [('id', 'in', ids)], context=context) + return partner_obj.name_get(cr, uid, ids, context=context) def reconcile_partial(self, cr, uid, ids, type='auto', context=None, writeoff_acc_id=False, writeoff_period_id=False, writeoff_journal_id=False): move_rec_obj = self.pool.get('account.move.reconcile')