From 1e03e6df7806619cc753fb9740146f276b116ed3 Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Tue, 14 May 2013 13:31:00 +0200 Subject: [PATCH] [FIX]res_partner: change fields selection of tz so that timezone starting with Etc/ are at the end of the selection, that way it's less confusing for the users. bzr revid: csn@openerp.com-20130514113100-h2oihowcplaba10j --- openerp/addons/base/res/res_partner.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/openerp/addons/base/res/res_partner.py b/openerp/addons/base/res/res_partner.py index fb4387fb3ae..fa31e26375c 100644 --- a/openerp/addons/base/res/res_partner.py +++ b/openerp/addons/base/res/res_partner.py @@ -74,7 +74,17 @@ class format_address(object): def _tz_get(self,cr,uid, context=None): - return [(x, x) for x in pytz.all_timezones] + #the timezone with name Etc/GMT+x are different than GMT+x, Etc/GMT+x actually is UTC-x and not UTC+x + #not a bug but an historical fact. Can be confusing, so we put those at the end of the list so that + #user won't get to much confused if they find in the list their country first + tz = [] + etc_tz = [] + for x in pytz.all_timezones: + if x.startswith('Etc/'): + etc_tz.append((x, x)) + else: + tz.append((x, x)) + return tz+etc_tz class res_partner_category(osv.osv):