diff --git a/addons/account/wizard/wizard_partner_balance_report.py b/addons/account/wizard/wizard_partner_balance_report.py index fac51eb1dcb..98c5d0a5984 100644 --- a/addons/account/wizard/wizard_partner_balance_report.py +++ b/addons/account/wizard/wizard_partner_balance_report.py @@ -29,30 +29,6 @@ import time import wizard import pooler -#report_type = ''' -#
-#
''' -# -# -#dates_form = ''' -#
-# -# -# -# -# -# -# -#''' -# -#dates_fields = { -# 'company_id': {'string': 'Company', 'type': 'many2one', 'relation': 'res.company', 'required': True}, -# 'result_selection':{'string':"Display partner ",'type':'selection','selection':[('customer','Debiteur'),('supplier','Creancier'),('all','Tous')]}, -# 'soldeinit':{'string':"Inclure les soldes initiaux",'type':'boolean'}, -# 'date1': {'string':'Start date', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')}, -# 'date2': {'string':'End date', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')}, -#} - period_form = '''
@@ -85,10 +61,9 @@ period_fields = { 'date2': {'string':'End date', 'type':'date', 'required':True,'default': lambda *a: time.strftime('%Y-%m-%d')}, } - class wizard_report(wizard.interface): - def _get_load(self,cr,uid,data,context): + def _get_defaults(self,cr,uid,data,context): user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid, context=context) if user.company_id: company_id = user.company_id.id @@ -104,7 +79,7 @@ class wizard_report(wizard.interface): data['form']['result_selection'] = 'all' return data['form'] - def _get_defaults(self, cr, uid, data, context): + def _check_state(self, cr, uid, data, context): if data['form']['state'] == 'byperiod': data['form']['fiscalyear'] = True @@ -113,18 +88,7 @@ class wizard_report(wizard.interface): data['form']['fiscalyear'] = False return data['form'] - -# def _get_defaults_fordate(self, cr, uid, data, context): -# user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid, context=context) -# if user.company_id: -# company_id = user.company_id.id -# else: -# company_id = pooler.get_pool(cr.dbname).get('res.company').search(cr, uid, [('parent_id', '=', False)])[0] -# data['form']['company_id'] = company_id -# data['form']['soldeinit'] = True -# data['form']['result_selection'] = 'all' -# return data['form'] - + def _check_date(self, cr, uid, data, context): sql = """ @@ -143,24 +107,12 @@ class wizard_report(wizard.interface): states = { 'init': { - 'actions': [_get_load], + 'actions': [_get_defaults], 'result': {'type':'form', 'arch':period_form, 'fields':period_fields, 'state':[('end','Cancel'),('report','Print')]} }, -# 'with_period': { -# 'actions': [_get_defaults], -# 'result': {'type':'form', 'arch':period_form, 'fields':period_fields, 'state':[('end','Cancel'),('report','Print')]} -# }, -# 'with_date': { -# 'actions': [_get_defaults_fordate], -# 'result': {'type':'form', 'arch':dates_form, 'fields':dates_fields, 'state':[('end','Cancel'),('checkdate','Print')]} -# }, -## 'checkdate': { -## 'actions': [], -## 'result': {'type':'choice','next_state':_check_date} -## }, 'report': { - 'actions': [_get_defaults], + 'actions': [_check_state], 'result': {'type':'print', 'report':'account.partner.balance', 'state':'end'} } }