From de19604dc0926ec4ab516b411950ac4a884c9ffa Mon Sep 17 00:00:00 2001 From: Leonardo Pistone Date: Thu, 30 Jan 2014 13:48:51 +0100 Subject: [PATCH] [fix] on the first/last day on the year, avoid choosing the opening/closing period. --- account_statement_ext/statement.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/account_statement_ext/statement.py b/account_statement_ext/statement.py index 80edbfcc..4c249a37 100644 --- a/account_statement_ext/statement.py +++ b/account_statement_ext/statement.py @@ -213,7 +213,10 @@ class AccountBankSatement(Model): """ Find matching period for date, used in the statement line creation. """ + if context is None: + context = {} period_obj = self.pool.get('account.period') + context['account_period_prefer_normal'] = True periods = period_obj.find(cr, uid, dt=date, context=context) return periods and periods[0] or False