Comment 22 for bug 362280

Revision history for this message
Adrien Guichard (guichard-adrien) wrote :

I change expression.py, in order to suppress "index" variable and to keep tables order OK. The code is the following (sorry, I could have attached a patch) :

From line 117 to 130 in expression.py (Openerp 5.0.10), after having applied the last patch:
            if left in table._inherit_fields:
                while True:
                    field = main_table._columns.get(fargs[0], False)
                    if field:
                        working_table = main_table
                        if self.__tables.has_key(i):
                            self.__tables[len(self.__tables)] = self.__tables[i]
                        self.__tables[i] = working_table
                        break
                    working_table = main_table.pool.get(main_table._inherit_fields[left][0])
                    if working_table not in self.__tables.values():
                        self.__joins.append(('%s.%s=%s.%s' % (working_table._table, 'id', main_table._table, main_table._inherits[working_table._name]), working_table._table))
                        self.__tables[len(self.__tables)] = working_table
                    main_table = working_table