[FIX] account: added check if country has a code
It is possible, if the user created a new country by himself, to have a country without a code, we then need to check that. Fixes opw 629891, where the customer wrote "Belgie" trying to find "België", didn't find it and created a new "Belgie" country without code.
This commit is contained in:
parent
2606e37b18
commit
373b560511
|
@ -7,7 +7,7 @@
|
||||||
wiz = wizards.browse(cr, uid, ref('account.account_configuration_installer_todo'))
|
wiz = wizards.browse(cr, uid, ref('account.account_configuration_installer_todo'))
|
||||||
part = self.pool.get('res.partner').browse(cr, uid, ref('base.main_partner'))
|
part = self.pool.get('res.partner').browse(cr, uid, ref('base.main_partner'))
|
||||||
# if we know the country and the wizard has not yet been executed, we do it
|
# if we know the country and the wizard has not yet been executed, we do it
|
||||||
if (part.country_id.id) and (wiz.state=='open'):
|
if (part.country_id.id) and (part.country_id.code) and (wiz.state=='open'):
|
||||||
mod = 'l10n_'+part.country_id.code.lower()
|
mod = 'l10n_'+part.country_id.code.lower()
|
||||||
ids = modules.search(cr, uid, [ ('name','=',mod) ], context=context)
|
ids = modules.search(cr, uid, [ ('name','=',mod) ], context=context)
|
||||||
if ids:
|
if ids:
|
||||||
|
|
Loading…
Reference in New Issue