mirror of
https://github.com/OCA/account-reconcile.git
synced 2025-01-20 12:27:39 +02:00
[FIX] at installation time, avoid the exception 'There is no period defined for this date'
This commit is contained in:
@@ -553,7 +553,11 @@ class AccountBankSatementLine(Model):
|
||||
if context is None:
|
||||
context = {}
|
||||
date = context.get('date')
|
||||
periods = self.pool.get('account.period').find(cr, uid, dt=date)
|
||||
try:
|
||||
periods = self.pool.get('account.period').find(cr, uid, dt=date)
|
||||
except osv.except_osv:
|
||||
# if no period defined, we are certainly at installation time
|
||||
return False
|
||||
return periods and periods[0] or False
|
||||
|
||||
def _get_default_account(self, cr, uid, context=None):
|
||||
|
||||
Reference in New Issue
Block a user