From 3adc2e907ee9304c244c6540607d67847759d216 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 24 Dec 2008 14:17:16 +0100 Subject: [PATCH] Fix join tables order in _order_calc for issue700 --- trytond/osv/orm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/trytond/osv/orm.py b/trytond/osv/orm.py index 552d1ffb2e..65db3e9f74 100644 --- a/trytond/osv/orm.py +++ b/trytond/osv/orm.py @@ -2922,7 +2922,7 @@ class ORM(object): '%s.id = %s.%s' % \ (table_name2, obj._table, link_field2) if table_join2 not in tables: - tables.insert(0, table_join2) + tables.insert(1, table_join2) return order_by, tables, tables_args if field_name in self._columns \ @@ -2965,7 +2965,7 @@ class ORM(object): '%s.id = %s.%s' % \ (table_name, self._table, link_field) if table_join not in tables: - tables.append(table_join) + tables.insert(0, table_join) return order_by, tables, tables_args raise Exception('Error', 'Wrong field name (%s) in order!' \