diff --git a/tryton/gui/window/view_tree/view_tree.py b/tryton/gui/window/view_tree/view_tree.py index dd640763e4..1c810262bd 100644 --- a/tryton/gui/window/view_tree/view_tree.py +++ b/tryton/gui/window/view_tree/view_tree.py @@ -103,6 +103,27 @@ class ViewTreeModel(gtk.GenericTreeModel, gtk.TreeSortable): if self.fields_type[field]['type'] in ('selection'): for obj in res_ids: if obj[field]: + selection = self.fields_type[field]['selection'] + if 'relation' in self.fields_type[field]: + try: + selection = rpc.execute('object', 'execute', + self.fields_type[field]['relation'], + 'name_search', '', + self.fields_type[field].get('domain', []), + 'ilike', rpc.CONTEXT) + except: + selection = [] + else: + if not isinstance(self.fields_type[field]['selection'], + (list, tuple)): + try: + selection = rpc.execute('object', 'execute', + self.view['model'], + self.fields_type[field]['selection'], + rpc.CONTEXT) + except: + selection = [] + self.fields_type[field]['selection'] = selection obj[field] = dict(self.fields_type[field]['selection'] ).get(obj[field],'') if self.fields_type[field]['type'] in ('float', 'numeric'):