improve_ergonomy

bzr revid: fp@tinyerp.com-20081027115259-v9erput59mnay2x8
This commit is contained in:
Fabien Pinckaers 2008-10-27 12:52:59 +01:00
parent 16bef69330
commit 732584721b
2 changed files with 66 additions and 59 deletions

View File

@ -1872,8 +1872,14 @@ class wizard_multi_charts_accounts(osv.osv_memory):
'code_digits':fields.integer('# of Digits',required=True,help="No. of Digits to use for account code"),
}
def _get_chart(self, cr, uid, context={}):
ids = self.pool.get('account.chart.template').search(cr, uid, [], context=context)
if ids:
return ids[0]
return False
_defaults = {
'company_id': lambda self, cr, uid, c: self.pool.get('res.users').browse(cr,uid,[uid],c)[0].company_id.id,
'chart_template_id': _get_chart,
'code_digits': lambda *a:6,
}

View File

@ -1607,6 +1607,7 @@
<field name="arch" type="xml">
<form string="Generate Chart of Accounts from a Chart Template">
<separator col="4" colspan="4" string="Generate Chart of Accounts from a Chart Template"/>
<label align="0.0" string="This will automatically configure your chart of accounts, bank accounts, taxes and journals according to the selected template" colspan="4"/>
<field name="company_id" />
<field name ="code_digits" />
<field name="chart_template_id" colspan="4"/>