.has_key() is deprecated, use 'in'
bzr revid: olt@tinyerp.com-20081215121502-f1e6onelzbtwjzo6
This commit is contained in:
parent
7015ae6cc6
commit
8f688adaa9
|
@ -497,7 +497,7 @@ class account_invoice(osv.osv):
|
|||
total_currency = 0
|
||||
key_line=[]
|
||||
for i in iml:
|
||||
if i.has_key('account_id') and i.has_key('taxes'):
|
||||
if 'account_id' in i and 'taxes' in i:
|
||||
if not (i['account_id'],i['taxes']) in key_line:
|
||||
key_line.append((i['account_id'],i['taxes']))
|
||||
if inv.currency_id.id != company_currency:
|
||||
|
@ -528,7 +528,7 @@ class account_invoice(osv.osv):
|
|||
if acc_obj.browse(cr,uid,item[0]).merge_invoice:
|
||||
repeat=False
|
||||
for move_line in iml:
|
||||
if (move_line.has_key('account_id') and move_line['account_id']==item[0]) and (move_line.has_key('taxes') and move_line['taxes']==item[1]):
|
||||
if (move_line.has_key('account_id') and move_line['account_id']==item[0]) and ('taxes' in move_line and move_line['taxes']==item[1]):
|
||||
move_list.append(move_line)
|
||||
if repeat:
|
||||
for key in move_line:
|
||||
|
@ -820,7 +820,7 @@ class account_invoice(osv.osv):
|
|||
types = {'out_invoice': -1, 'in_invoice': 1, 'out_refund': 1, 'in_refund': -1}
|
||||
direction = types[invoice.type]
|
||||
#take the choosen date
|
||||
if context.has_key('date_p') and context['date_p']:
|
||||
if 'date_p' in context and context['date_p']:
|
||||
date=context['date_p']
|
||||
else:
|
||||
date=time.strftime('%Y-%m-%d')
|
||||
|
|
Loading…
Reference in New Issue