From 762cfbf1cce04d029aa620d9cfbf7086199f795c Mon Sep 17 00:00:00 2001 From: "qdp-launchpad@tinyerp.com" <> Date: Fri, 11 Jun 2010 17:49:23 +0200 Subject: [PATCH] [IMP] added default values bzr revid: qdp-launchpad@tinyerp.com-20100611154923-nujxdrg929989etl --- .../account/wizard/account_common_report.py | 36 +++++++++++++------ .../account/wizard/account_common_report.xml | 2 +- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/addons/account/wizard/account_common_report.py b/addons/account/wizard/account_common_report.py index 34d74999119..6fdf5e9a1d4 100644 --- a/addons/account/wizard/account_common_report.py +++ b/addons/account/wizard/account_common_report.py @@ -64,19 +64,35 @@ class account_common_report(osv.osv_memory): else: return company_obj.search(cr, uid, [('parent_id', '=', False)])[0] + def _get_account(self, cr, uid, context=None): + tmp = self.pool.get('account.account').search(cr, uid, [], limit=1 ) + if not tmp: + return False + return tmp[0] + def _get_fiscalyear(self, cr, uid, context=None): - return 1 + now = time.strftime('%Y-%m-%d') + tmp = self.pool.get('account.fiscalyear').search(cr, uid, [('date_start', '<', now), ('date_stop', '>', now)], limit=1 ) + if not tmp: + return False + return tmp[0] + + def _get_all_journal(self, cr, uid, context=None): + return self.pool.get('account.journal').search(cr, uid ,[]) _defaults = { - 'state' : 'none', - 'date_from' : time.strftime('%Y-01-01'), - 'date_to' : time.strftime('%Y-%m-%d'), - 'company_id' : _get_company, - 'display_account' : 'bal_all', - 'sortbydate' : 'sort_date', - 'fiscalyear' : _get_fiscalyear, - 'landscape': True, - 'amount_currency' : True, +# 'state' : 'none', +# 'date_from' : time.strftime('%Y-01-01'), +# 'date_to' : time.strftime('%Y-%m-%d'), +# 'company_id' : _get_company, +# 'display_account' : 'bal_all', +# 'sortbydate' : 'sort_date', + 'fiscalyear_id' : _get_fiscalyear, +# 'landscape': True, +# 'amount_currency' : True, + 'journal_ids': _get_all_journal, + 'filter': 'filter_no', + 'account_id': _get_account, } def next_view(self, cr, uid, ids, context=None): diff --git a/addons/account/wizard/account_common_report.xml b/addons/account/wizard/account_common_report.xml index 3927ca93401..4f2fecabd9a 100644 --- a/addons/account/wizard/account_common_report.xml +++ b/addons/account/wizard/account_common_report.xml @@ -10,7 +10,7 @@ - +