Fix KeyError: 'active_model'

This commit is contained in:
jmartin 2014-07-16 09:49:16 +02:00
parent 8326f68e0b
commit f0fb210dfe
1 changed files with 2 additions and 2 deletions

View File

@ -17,9 +17,9 @@ class Move:
Account = pool.get('account.account')
MoveLine = pool.get('account.move.line')
context = Transaction().context
if context['active_model'] == 'account.move.line':
if context.get('active_model') == 'account.move.line':
party = None
for active_id in context['active_ids']:
for active_id in context.get('active_ids', []):
move_line = MoveLine(active_id)
if getattr(move_line, 'party'):
party = move_line.party