From 21a9b9e064bcf30bbdb3392728e7abcf4dafbc76 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Sun, 23 Nov 2008 12:07:17 +0100 Subject: [PATCH] bugfix_301049 bzr revid: fp@tinyerp.com-20081123110717-c7odqp2ri7du65s0 --- bin/osv/fields.py | 4 +++- bin/tools/translate.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/osv/fields.py b/bin/osv/fields.py index dd46d7654fb..07f72e5b859 100644 --- a/bin/osv/fields.py +++ b/bin/osv/fields.py @@ -678,7 +678,8 @@ class related(function): where += " %s.%s %s '%s' and" % (obj_child._table, self._arg[i], context[0][1], context[0][2]) if field_detail[1] in ['integer', 'long', 'float','integer_big']: where += " %s.%s %s '%d' and" % (obj_child._table, self._arg[i], context[0][1], context[0][2]) - query += where.rstrip('and') + if len(where)>10: + query += where.rstrip('and') cr.execute(query) ids = [] for id in cr.fetchall(): @@ -718,6 +719,7 @@ class related(function): # TODO: call field_get on the object, not in the DB def _field_get(self, cr, uid, obj, model_name, prop): + print model_name, prop fields = obj.pool.get(model_name).fields_get(cr, uid,) if fields.get(prop, False): return(fields[prop].get('relation', False), fields[prop].get('type', False), fields) diff --git a/bin/tools/translate.py b/bin/tools/translate.py index c5630d7bcff..b222daed5ac 100644 --- a/bin/tools/translate.py +++ b/bin/tools/translate.py @@ -109,7 +109,7 @@ class TinyPoFile(object): if line.startswith('#:'): tmp_tnrs.append( line[2:].strip().split(':') ) line = self.lines.pop(0).strip() - while not line: + while (not line) and self.lines: # allow empty lines between comments and msgid line = self.lines.pop(0).strip() if not line.startswith('msgid'):