From 0e233a7dcb744389bb63eae8edd9c7236b20c140 Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Mon, 25 Oct 2010 10:23:36 +0530 Subject: [PATCH] [REF] bzr revid: mra@mra-laptop-20101025045336-ovh54n0q31db0hfp --- addons/account/account_move_line.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 8200a7fc321..ffea12170a2 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -365,7 +365,7 @@ class account_move_line(osv.osv): return [('id', '=', '0')] return [('id', 'in', [x[0] for x in res])] - def _invoice_search(self, cursor, user, obj, name, args, context): + def _invoice_search(self, cursor, user, obj, name, args, context=None): if not args: return [] invoice_obj = self.pool.get('account.invoice') @@ -410,7 +410,7 @@ class account_move_line(osv.osv): return [('id', '=', '0')] return [('id', 'in', [x[0] for x in res])] - def _get_move_lines(self, cr, uid, ids, context={}): + def _get_move_lines(self, cr, uid, ids, context=None): result = [] for move in self.pool.get('account.move').browse(cr, uid, ids, context=context): for line in move.line_id: @@ -460,7 +460,7 @@ class account_move_line(osv.osv): 'company_id': fields.related('account_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True) } - def _get_date(self, cr, uid, context): + def _get_date(self, cr, uid, context=None): period_obj = self.pool.get('account.period') dt = time.strftime('%Y-%m-%d') if ('journal_id' in context) and ('period_id' in context): @@ -476,7 +476,9 @@ class account_move_line(osv.osv): dt = period.date_start return dt - def _get_currency(self, cr, uid, context={}): + def _get_currency(self, cr, uid, context=None): + if context is None: + context = {} if not context.get('journal_id', False): return False cur = self.pool.get('account.journal').browse(cr, uid, context['journal_id']).currency @@ -1247,4 +1249,4 @@ class account_move_line(osv.osv): account_move_line() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file