[IMP] Improved default view and method of set accounting options wizard

bzr revid: pso@tinyerp.com-20120820073038-3dmkx96br61t9gd0
This commit is contained in:
pso (OpenERP) 2012-08-20 13:00:38 +05:30
parent e8a3d11ba3
commit 56177da6c5
2 changed files with 4 additions and 6 deletions

View File

@ -3039,12 +3039,9 @@ class wizard_multi_charts_accounts(osv.osv_memory):
company_id = res.get('company_id') or False
if company_id:
company_obj = self.pool.get('res.company')
company = company_obj.browse(cr, uid, company_id, context=context)
if company.country_id and company.country_id.currency_id:
res.update({'currency_id': company.country_id.currency_id.id})
else:
currency_id = company_obj._get_euro(cr, uid, context=context)
res.update({'currency_id': currency_id})
country_id = company_obj.browse(cr, uid, company_id, context=context).country_id.id
currency_id = company_obj.on_change_country(cr, uid, company_id, country_id, context=context)['value']['currency_id']
res.update({'currency_id': currency_id})
ids = self.pool.get('account.chart.template').search(cr, uid, [('visible', '=', True)], context=context)
if ids:

View File

@ -2371,6 +2371,7 @@
<div groups="base.group_multi_company">
<label for="company_id"/>
<field name="company_id" widget="selection"/> <!-- we assume that this wizard will be run only by administrators and as this field may cause problem if hidden (because of the default company of the user removed from the selection because already configured), we simply choosed to remove the group "multi company" of it -->
<label for="currency_id"/>
<field name="currency_id" />
</div>
<group>