Update tree view to use the new selection behavior

This commit is contained in:
Cédric Krier committed 2008-03-17 17:19:34 +01:00
1 parent 4fa9781788
commit fed8edcbfe
1 file changed
+21
+21
View File
@@ -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'):