[FIX] Account: [6.RC2] Account chart wizard does not check if generated account code for bank journal exsits
lp bug: https://launchpad.net/bugs/684119 fixed bzr revid: mra@mra-laptop-20101224125947-lgw0mhlbb4kw2226
This commit is contained in:
parent
2ae889eda1
commit
e39f771e91
|
@ -2613,11 +2613,13 @@ class wizard_multi_charts_accounts(osv.osv_memory):
|
|||
cr.execute("SELECT company_id FROM account_account WHERE active = 't' AND account_account.parent_id IS NULL AND name != %s", ("Chart For Automated Tests",))
|
||||
configured_cmp = [r[0] for r in cr.fetchall()]
|
||||
unconfigured_cmp = list(set(company_ids)-set(configured_cmp))
|
||||
if unconfigured_cmp:
|
||||
cmp_select = [(line.id, line.name) for line in self.pool.get('res.company').browse(cr, uid, unconfigured_cmp)]
|
||||
for field in res['fields']:
|
||||
if field == 'company_id':
|
||||
res['fields'][field]['domain'] = unconfigured_cmp
|
||||
print unconfigured_cmp
|
||||
for field in res['fields']:
|
||||
if field == 'company_id':
|
||||
res['fields'][field]['domain'] = unconfigured_cmp
|
||||
res['fields'][field]['selection'] = [('', '')]
|
||||
if unconfigured_cmp:
|
||||
cmp_select = [(line.id, line.name) for line in self.pool.get('res.company').browse(cr, uid, unconfigured_cmp)]
|
||||
res['fields'][field]['selection'] = cmp_select
|
||||
return res
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ class account_installer(osv.osv_memory):
|
|||
'bank_accounts_id': _get_default_accounts,
|
||||
'charts': _get_default_charts
|
||||
}
|
||||
|
||||
|
||||
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
|
||||
res = super(account_installer, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar,submenu=False)
|
||||
configured_cmp = []
|
||||
|
@ -106,11 +106,12 @@ class account_installer(osv.osv_memory):
|
|||
cr.execute("SELECT company_id FROM account_account WHERE active = 't' AND account_account.parent_id IS NULL AND name != %s", ("Chart For Automated Tests",))
|
||||
configured_cmp = [r[0] for r in cr.fetchall()]
|
||||
unconfigured_cmp = list(set(company_ids)-set(configured_cmp))
|
||||
if unconfigured_cmp:
|
||||
cmp_select = [(line.id, line.name) for line in self.pool.get('res.company').browse(cr, uid, unconfigured_cmp)]
|
||||
for field in res['fields']:
|
||||
if field == 'company_id':
|
||||
res['fields'][field]['domain'] = unconfigured_cmp
|
||||
for field in res['fields']:
|
||||
if field == 'company_id':
|
||||
res['fields'][field]['domain'] = unconfigured_cmp
|
||||
res['fields'][field]['selection'] = [('', '')]
|
||||
if unconfigured_cmp:
|
||||
cmp_select = [(line.id, line.name) for line in self.pool.get('res.company').browse(cr, uid, unconfigured_cmp)]
|
||||
res['fields'][field]['selection'] = cmp_select
|
||||
return res
|
||||
|
||||
|
|
Loading…
Reference in New Issue