[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:
David Monjoie 2015-03-16 10:33:03 +01:00
parent 2606e37b18
commit 373b560511
1 changed files with 1 additions and 1 deletions

View File

@ -7,7 +7,7 @@
wiz = wizards.browse(cr, uid, ref('account.account_configuration_installer_todo'))
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 (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()
ids = modules.search(cr, uid, [ ('name','=',mod) ], context=context)
if ids: