From fb2ad5e31d1c43eecff6672baaa8830d7d73c4fe Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Tue, 21 Sep 2010 15:58:55 +0530 Subject: [PATCH] [FIX] Account: reconcile next partner if the partner is empty on move lines dont write last rec. date on it bzr revid: mra@mra-laptop-20100921102855-wu1fdh91giv97cxn --- addons/account/wizard/account_reconcile_partner_process.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/account/wizard/account_reconcile_partner_process.py b/addons/account/wizard/account_reconcile_partner_process.py index d1b84e08a9d..05a1bbd48af 100644 --- a/addons/account/wizard/account_reconcile_partner_process.py +++ b/addons/account/wizard/account_reconcile_partner_process.py @@ -67,8 +67,9 @@ class account_partner_reconcile_process(osv.osv_memory): return res def next_partner(self, cr, uid, ids, context=None): - partner_id = self.pool.get('account.move.line').read(cr, uid, context['active_id'], ['partner_id'])['partner_id'][0] - self.pool.get('res.partner').write(cr, uid, partner_id, {'last_reconciliation_date': time.strftime('%Y-%m-%d')}, context) + partner_id = self.pool.get('account.move.line').read(cr, uid, context['active_id'], ['partner_id'])['partner_id'] + if partner_id: + self.pool.get('res.partner').write(cr, uid, partner_id[0], {'last_reconciliation_date': time.strftime('%Y-%m-%d')}, context) #TODO: we have to find a way to update the context of the current tab (we could open a new tab with the context but it's not really handy) #TODO: remove that comments when the client side dev is done return {}