summaryrefslogtreecommitdiff
path: root/bin/osv/expression.py
diff options
context:
space:
mode:
authorJay (Open ERP) <jvo@tinyerp.com>2010-05-20 12:00:44 +0530
committerJay (Open ERP) <jvo@tinyerp.com>2010-05-20 12:00:44 +0530
commite3ccef27d33ff83ddbb7bfd3eacc80f8a98bd21d (patch)
treef14fb77ab9702c91bcb9309724e5aa63a96ee570 /bin/osv/expression.py
parent2669744f4f09ca6ac9219dc91909e895559c74c0 (diff)
parentfe7673b7ba1f2706b8ed2abe6892ad33211063cd (diff)
[BACKPORT] Stable fixes and refactorings to Trunk
bzr revid: jvo@tinyerp.com-20100520063044-sviy1e9pybirhpsw
Diffstat (limited to 'bin/osv/expression.py')
-rw-r--r--bin/osv/expression.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/bin/osv/expression.py b/bin/osv/expression.py
index 4e6e1aade6f..2ca19bbf418 100644
--- a/bin/osv/expression.py
+++ b/bin/osv/expression.py
@@ -280,8 +280,11 @@ class expression(object):
c = context.copy()
c['active_test'] = False
res_ids = field_obj.name_search(cr, uid, right, [], operator, limit=None, context=c)
- right = map(lambda x: x[0], res_ids)
- self.__exp[i] = (left, 'in', right)
+ if not res_ids:
+ self.__exp[i] = ('id','=',0)
+ else:
+ right = map(lambda x: x[0], res_ids)
+ self.__exp[i] = (left, 'in', right)
else:
# other field type
# add the time part to datetime field when it's not there: