From e4b5311cede44e9d54cbe1d09c1cfd78d22fd455 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 27 May 2008 14:55:32 +0200 Subject: [PATCH] Fix convert uri to object for attachment on non directory objects --- trytond/webdav/webdav.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/trytond/webdav/webdav.py b/trytond/webdav/webdav.py index f375fa7c60..82cec19ed1 100644 --- a/trytond/webdav/webdav.py +++ b/trytond/webdav/webdav.py @@ -85,10 +85,12 @@ class Directory(OSV): object_name = None object_id = False else: + object_id = int(name.rsplit('-', 1)[1].strip()) if uri: if '/' in uri: return None, 0 #TODO add report + name = uri attachment_ids = attachment_obj.search(cursor, user, [ ('res_model', '=', object_name), ('res_id', '=', object_id), @@ -101,8 +103,6 @@ class Directory(OSV): object_name = None object_id = False return object_name, object_id - else: - object_id = int(name.rsplit('-', 1)[1].strip()) if uri: return self._uri2object(cursor, user, uri, object_name, object_id, context)