From 6e5389b45c27843e4f6c072dc253ccdd33c11ae5 Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Thu, 23 Sep 2010 11:17:31 +0530 Subject: [PATCH] [REF] bzr revid: mra@mra-laptop-20100923054731-clnbpxtj41rbtnj0 --- addons/account/installer.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/addons/account/installer.py b/addons/account/installer.py index 75812fb03bc..fc532d6ed9b 100644 --- a/addons/account/installer.py +++ b/addons/account/installer.py @@ -67,13 +67,13 @@ class account_installer(osv.osv_memory): 'company_id': fields.many2one('res.company', 'Company'), } - def _default_company(self, cr, uid, context={}): + def _default_company(self, cr, uid, context=None): user = self.pool.get('res.users').browse(cr, uid, uid, context=context) if user.company_id: return user.company_id.id return False - def _get_default_charts(self, cr, uid, context={}): + def _get_default_charts(self, cr, uid, context=None): module_name = False company_id = self._default_company(cr, uid, context=context) company = self.pool.get('res.company').browse(cr, uid, company_id) @@ -91,18 +91,18 @@ class account_installer(osv.osv_memory): _defaults = { 'date_start': lambda *a: time.strftime('%Y-01-01'), 'date_stop': lambda *a: time.strftime('%Y-12-31'), - 'period':lambda *a:'month', - 'sale_tax':lambda *a:0.0, - 'purchase_tax':lambda *a:0.0, + 'period': lambda *a:'month', + 'sale_tax': lambda *a:0.0, + 'purchase_tax': lambda *a:0.0, 'company_id': _default_company, - 'bank_accounts_id':_get_default_accounts, + 'bank_accounts_id': _get_default_accounts, 'charts': _get_default_charts } def on_change_tax(self, cr, uid, id, tax): return {'value':{'purchase_tax':tax}} - def on_change_start_date(self, cr, uid, id, start_date): + def on_change_start_date(self, cr, uid, id, start_date=False): if start_date: start_date = datetime.datetime.strptime(start_date, "%Y-%m-%d") end_date = (start_date + relativedelta(months=12)) - relativedelta(days=1) @@ -720,11 +720,12 @@ class account_installer_modules(osv.osv_memory): # 'account_voucher_payment':fields.boolean('Voucher and Reconcile Management', # help="Extension Account Voucher module includes allows to link payment / receipt " # "entries with voucher, also automatically reconcile during the payment and receipt entries."), - } + } _defaults = { 'account_voucher': True, - } + } + account_installer_modules() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file