From ac2af24c2d11384a3f7f4b78f849a489675441f5 Mon Sep 17 00:00:00 2001
From: Vincent Pelletier <vincent@nexedi.com>
Date: Wed, 11 Mar 2009 16:31:00 +0000
Subject: [PATCH] Do not alias translation table to a hardcoded value: if one
 uses more than one related key involving translation table columns, they are
 all mapped to the same alias - so there is only one join happening.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25988 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ZSQLCatalog/ColumnMap.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/product/ZSQLCatalog/ColumnMap.py b/product/ZSQLCatalog/ColumnMap.py
index 684f4c8d0e..c164f9f053 100644
--- a/product/ZSQLCatalog/ColumnMap.py
+++ b/product/ZSQLCatalog/ColumnMap.py
@@ -141,7 +141,7 @@ class ColumnMap(object):
     self.related_group_dict[group] = related_column
     # XXX: hardcoded translation table column names: they are not present in sql_catalog.getColumnMap(), and this table cannot be joined by uid, forbidding implicit join.
     if column in ('translated_message', 'language', 'message_context', 'original_message'):
-      self.registerTable('translation', alias='translation', group=group)
+      self.registerTable('translation', group=group)
       self.resolveColumn(column, 'translation', group=group)
     # Likewise, for measure table. Moreover, there is a related key named the same way as a column of that table (designed to do the join).
     elif column in ('metric_type_uid', ):
-- 
2.30.9