[fix] similarly fix another _get_period

This commit is contained in:
Leonardo Pistone
2014-01-30 14:11:58 +01:00
parent 0eb7bf7825
commit 5c728ccd48

View File

@@ -576,9 +576,12 @@ class AccountBankSatementLine(Model):
"""Return matching period for a date."""
if context is None:
context = {}
period_obj = self.pool['account.period']
date = context.get('date')
local_context = context.copy()
local_context['account_period_prefer_normal'] = True
try:
periods = self.pool.get('account.period').find(cr, uid, dt=date)
periods = period_obj.find(cr, uid, dt=date, context=local_context)
except osv.except_osv:
# if no period defined, we are certainly at installation time
return False