diff --git a/addons/account/wizard/account_bs_report.py b/addons/account/wizard/account_bs_report.py index 0faa27ccc2f..a5104d7d9dd 100644 --- a/addons/account/wizard/account_bs_report.py +++ b/addons/account/wizard/account_bs_report.py @@ -45,28 +45,11 @@ class account_bs_report(osv.osv_memory): 'display_type': True, } - def _check_date(self, cr, uid, data, context=None): - if context is None: - context = {} - sql = """ - SELECT f.id, f.date_start, f.date_stop FROM account_fiscalyear f Where %s between f.date_start and f.date_stop """ - cr.execute(sql,(data['form']['date_from'],)) - res = cr.dictfetchall() - if res: - - if (data['form']['date_to'] > res[0]['date_stop'] or data['form']['date_to'] < res[0]['date_start']): - raise osv.except_osv(_('UserError'),_('Date to must be set between %s and %s') % (res[0]['date_start'], res[0]['date_stop'])) - else: - raise osv.except_osv(_('UserError'),_('Date not in a defined fiscal year')) - return True - def _print_report(self, cr, uid, ids, data, query_line, context=None): if context is None: context = {} data['form'].update(self.read(cr, uid, ids, ['display_account', 'display_type', 'reserve_account_id'])[0]) data['form']['query_line'] = query_line - if data['form']['filter'] == 'filter_date': - self._check_date(cr, uid, data, context=context) if data['form']['display_type']: return { 'type': 'ir.actions.report.xml', diff --git a/addons/account/wizard/account_general_ledger_report.py b/addons/account/wizard/account_general_ledger_report.py index ad5e74786b0..5529f4d6b9a 100644 --- a/addons/account/wizard/account_general_ledger_report.py +++ b/addons/account/wizard/account_general_ledger_report.py @@ -91,34 +91,6 @@ class account_general_ledger_report(osv.osv_memory): 'context': context } - def _check_date(self, cr, uid, data, context=None): - if context is None: - context = {} - sql = """ - SELECT f.id, f.date_start, f.date_stop FROM account_fiscalyear f Where %s between f.date_start and f.date_stop """ - cr.execute(sql, (data['form']['date_from'],)) - res = cr.dictfetchall() - if res: - if (data['form']['date_to'] > res[0]['date_stop'] or data['form']['date_to'] < res[0]['date_start']): - raise osv.except_osv(_('UserError'),_('Date to must be set between %s and %s') % (str(res[0]['date_start']), str(res[0]['date_stop']))) - else: - if data['form']['landscape'] == True: - return { - 'type': 'ir.actions.report.xml', - 'report_name': 'account.general.ledger_landscape', - 'datas': data, - 'nodestroy':True, - } - else: - return { - 'type': 'ir.actions.report.xml', - 'report_name': 'account.general.ledger', - 'datas': data, - 'nodestroy':True, - } - else: - raise osv.except_osv(_('UserError'),_('Date not in a defined fiscal year')) - def check_report(self, cr, uid, ids, context=None): if context is None: context = {} @@ -131,11 +103,6 @@ class account_general_ledger_report(osv.osv_memory): else: data['model'] = 'account.account' data['form']['context'] = context - if data['form']['state'] == 'bydate': - return self._check_date(cr, uid, data, context) - elif data['form']['state'] == 'byperiod': - if not data['form']['periods']: - raise osv.except_osv(_('Data Insufficient !'),_('Please select periods.')) if data['form']['landscape'] == True: return { 'type': 'ir.actions.report.xml', diff --git a/addons/account/wizard/account_partner_balance_report.py b/addons/account/wizard/account_partner_balance_report.py index 7be76501701..dd44bbfff95 100644 --- a/addons/account/wizard/account_partner_balance_report.py +++ b/addons/account/wizard/account_partner_balance_report.py @@ -35,24 +35,11 @@ class account_partner_balance(osv.osv_memory): 'soldeinit' : True, } - def _check_date(self, cr, uid, data, context=None): - sql = """ SELECT f.id, f.date_start, f.date_stop FROM account_fiscalyear f Where %s between f.date_start and f.date_stop """ - cr.execute(sql, (data['form']['date_from'],)) - res = cr.dictfetchall() - if res: - if (data['form']['date_to'] > res[0]['date_stop'] or data['form']['date_to'] < res[0]['date_start']): - raise osv.except_osv(_('UserError'),_('Date to must be set between %s and %s') % (str(res[0]['date_start']), str(res[0]['date_stop']))) - else: - raise osv.except_osv(_('UserError'),_('Date not in a defined fiscal year')) - return True - def _print_report(self, cr, uid, ids, data, query_line, context=None): if context is None: context = {} data = self.pre_print_report(cr, uid, ids, data, query_line, context=context) data['form'].update(self.read(cr, uid, ids, ['soldeinit'])[0]) - if data['form']['filter'] == 'filter_date': - self._check_date(cr, uid, data, context=context) return { 'type': 'ir.actions.report.xml', 'report_name': 'account.partner.balance', diff --git a/addons/account/wizard/account_pl_report.py b/addons/account/wizard/account_pl_report.py index 39d88508089..1cc21c5796a 100644 --- a/addons/account/wizard/account_pl_report.py +++ b/addons/account/wizard/account_pl_report.py @@ -43,26 +43,11 @@ class account_pl_report(osv.osv_memory): 'display_type': True, } - def _check_date(self, cr, uid, data, context=None): - if context is None: - context = {} - sql = """ SELECT f.id, f.date_start, f.date_stop FROM account_fiscalyear f Where %s between f.date_start and f.date_stop """ - cr.execute(sql,(data['form']['date_from'],)) - res = cr.dictfetchall() - if res: - if (data['form']['date_to'] > res[0]['date_stop'] or data['form']['date_to'] < res[0]['date_start']): - raise osv.except_osv(_('UserError'),_('Date to must be set between %s and %s') % (res[0]['date_start'], res[0]['date_stop'])) - else: - raise osv.except_osv(_('UserError'),_('Date not in a defined fiscal year')) - return True - def _print_report(self, cr, uid, ids, data, query_line, context=None): if context is None: context = {} data['form'].update(self.read(cr, uid, ids, ['display_account', 'display_type'])[0]) data['form']['query_line'] = query_line - if data['form']['filter'] == 'filter_date': - self._check_date(cr, uid, data, context=context) if data['form']['display_type']: return { 'type': 'ir.actions.report.xml', diff --git a/addons/account/wizard/account_third_party_ledger.py b/addons/account/wizard/account_third_party_ledger.py index 6fbc22d7197..250f7602bb9 100644 --- a/addons/account/wizard/account_third_party_ledger.py +++ b/addons/account/wizard/account_third_party_ledger.py @@ -40,27 +40,11 @@ class account_partner_ledger(osv.osv_memory): 'page_split' : False, } - def _check_date(self, cr, uid, data, context=None): - if context is None: - context = {} - sql = """ - SELECT f.id, f.date_start, f.date_stop FROM account_fiscalyear f Where %s between f.date_start and f.date_stop """ - cr.execute(sql, (data['form']['date_from'],)) - res = cr.dictfetchall() - if res: - if (data['form']['date_to'] > res[0]['date_stop'] or data['form']['date_to'] < res[0]['date_start']): - raise osv.except_osv(_('UserError'),_('Date to must be set between %s and %s') % (str(res[0]['date_start']), str(res[0]['date_stop']))) - else: - raise osv.except_osv(_('UserError'),_('Date not in a defined fiscal year')) - return True - def _print_report(self, cr, uid, ids, data, query_line, context=None): if context is None: context = {} data = self.pre_print_report(cr, uid, ids, data, query_line, context=context) data['form'].update(self.read(cr, uid, ids, ['soldeinit', 'reconcil', 'page_split', 'amount_currency'])[0]) - if data['form']['filter'] == 'filter_date': - self._check_date(cr, uid, data, context) if data['form']['page_split']: return { 'type': 'ir.actions.report.xml',