From e147a1cc2e8d8e0d85f1f9da8953d0506ea57c5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 27 Aug 2010 12:05:37 +0200 Subject: [PATCH] Fix for new Transaction --- trytond/ir/attachment.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/trytond/ir/attachment.py b/trytond/ir/attachment.py index 5d857dc1d8..7aa20bf8ee 100644 --- a/trytond/ir/attachment.py +++ b/trytond/ir/attachment.py @@ -53,9 +53,7 @@ class Attachment(ModelSQL, ModelView): table.drop_column('res_id') def default_resource(self): - if context is None: - context = {} - return context.get('resource') + return Transaction().context.get('resource') def default_collision(self): return 0