From e7e7ba0e58225228342bd752cf6beed0dc3f1505 Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Fri, 11 Jun 2010 18:33:42 +0530 Subject: [PATCH] [REF] account move line bzr revid: mra@mra-laptop-20100611130342-cfd8r0nf2syuxwp3 --- addons/account/account_move_line.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 84dd2c90e7c..c599c7c4447 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -577,13 +577,16 @@ class account_move_line(osv.osv): # writeoff; entry generated for the difference between the lines # - def reconcile_partial(self, cr, uid, ids, type='auto', context={}): + def reconcile_partial(self, cr, uid, ids, type='auto', context=None): merges = [] unmerge = [] total = 0.0 merges_rec = [] company_list = [] + if context is None: + context = {} + for line in self.browse(cr, uid, ids, context=context): if company_list and not line.company_id.id in company_list: raise osv.except_osv(_('Warning !'), _('To reconcile the entries company should be the same for all entries')) @@ -613,13 +616,15 @@ class account_move_line(osv.osv): self.pool.get('account.move.reconcile').reconcile_partial_check(cr, uid, [r_id] + merges_rec, context=context) return True - def reconcile(self, cr, uid, ids, type='auto', writeoff_acc_id=False, writeoff_period_id=False, writeoff_journal_id=False, context={}): + def reconcile(self, cr, uid, ids, type='auto', writeoff_acc_id=False, writeoff_period_id=False, writeoff_journal_id=False, context=None): lines = self.browse(cr, uid, ids, context=context) unrec_lines = filter(lambda x: not x['reconcile_id'], lines) credit = debit = 0.0 currency = 0.0 account_id = False partner_id = False + if context is None: + context = {} company_list = [] for line in self.browse(cr, uid, ids, context=context):