Skip to content

Commit

Permalink
Using column from foreign_key function
Browse files Browse the repository at this point in the history
This allows work with one2many fields
  • Loading branch information
ecarreras committed Dec 22, 2016
1 parent 88d7185 commit 4f68254
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ooquery/parser.py
Expand Up @@ -46,7 +46,7 @@ def parse(self, query):
fk = self.foreign_key(table._name)[field_join]
table_join = Table(fk['foreign_table_name'])
join = Join(self.join_on, table_join)
column = getattr(table, field_join)
column = getattr(table, fk['column_name'])
fk_col = getattr(join.right, fk['foreign_column_name'])
join.condition = Equal(column, fk_col)
join = self.get_join(join)
Expand Down

0 comments on commit 4f68254

Please sign in to comment.