[FIX]account : list index error when context have wrong period

bzr revid: mma@tinyerp.com-20121101122231-zrktnx90q7wj76iq
This commit is contained in:
Mayur Maheshwari (OpenERP) 2012-11-01 17:52:31 +05:30
parent b006809773
commit e999acd0e3
1 changed files with 1 additions and 1 deletions

View File

@ -208,7 +208,7 @@ class account_move_line(osv.osv):
if type(period_id) == str:
ids = period_obj.search(cr, uid, [('name', 'ilike', period_id)])
context.update({
'period_id': ids[0]
'period_id': ids and ids[0] or False
})
return context