From cac9fb4e0322ad041acc2cdb9e9a90322b9decba Mon Sep 17 00:00:00 2001 From: "tfr@openerp.com" <> Date: Tue, 12 Jul 2011 16:02:13 +0200 Subject: [PATCH] [FIX] get hostname using tools.get_hostname bzr revid: tfr@openerp.com-20110712140213-flf80sbimzhkmekx --- addons/caldav/wizard/caldav_browse.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/addons/caldav/wizard/caldav_browse.py b/addons/caldav/wizard/caldav_browse.py index f6ecc5dccd5..49b313b9886 100644 --- a/addons/caldav/wizard/caldav_browse.py +++ b/addons/caldav/wizard/caldav_browse.py @@ -24,6 +24,7 @@ from tools import config import base64 import addons from tools.translate import _ +import tools class caldav_browse(osv.osv_memory): @@ -239,12 +240,8 @@ class user_preference(osv.osv_memory): return ids[0] def _get_default_host(self, cr, uid, context): - ids=self.search(cr,uid,[]) - host_name = '' - if ids: - ids = len(ids)> 1 and len(ids)-1 or ids[0] # Use len(ids)-1 for taking the value of last id - host_name = self.browse(cr, uid,[ids],context=context)[0].host_name - return host_name + + return tools.get_hostname(self, cr, uid) _defaults={ 'service': 'webdav',