From 97bc54adcd95e5352cc94b032577e5a87faa3d48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20=C3=89vrard?= Date: Mon, 7 Feb 2011 18:14:58 +0100 Subject: [PATCH] Fix set_client for ReferenceField to support basestring values (transplanted from 5bbbe0bfad08bce235bc96f871b5341a956bbf26) --- tryton/gui/window/view_form/model/field.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tryton/gui/window/view_form/model/field.py b/tryton/gui/window/view_form/model/field.py index 2e5b460e12..3414088e18 100644 --- a/tryton/gui/window/view_form/model/field.py +++ b/tryton/gui/window/view_form/model/field.py @@ -613,6 +613,9 @@ class ReferenceField(CharField): if not value: record.value[self.name] = False return + if isinstance(value, basestring): + model, ref_id = value.split(',') + value = model, (ref_id, record.value.get(self.name + '.rec_name')) ref_model, (ref_id, ref_str) = value if ref_model: ref_id = int(ref_id)