From 373b56051101b8d4b87579a741ce552142d82410 Mon Sep 17 00:00:00 2001 From: David Monjoie Date: Mon, 16 Mar 2015 10:33:03 +0100 Subject: [PATCH] [FIX] account: added check if country has a code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- addons/account/account_pre_install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/account_pre_install.yml b/addons/account/account_pre_install.yml index e295989e698..798c0d954a5 100644 --- a/addons/account/account_pre_install.yml +++ b/addons/account/account_pre_install.yml @@ -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: