[FIX] account_banking: Fix for bug whereby statement imports made on the first day of the year use the opening period rather than the normal period for that day.

This commit is contained in:
unknown
2013-12-16 16:39:27 +01:00
committed by Pedro M. Baeza

View File

@@ -426,7 +426,10 @@ class account_bank_statement(osv.osv):
'''
Find matching period for date, not meant for _defaults.
'''
if context is None:
context = {}
period_obj = self.pool.get('account.period')
context['account_period_prefer_normal'] = True
periods = period_obj.find(cursor, uid, dt=date, context=context)
return periods and periods[0] or False