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
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: 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
if left in table._