Skip to content

Commit

Permalink
fix: use primary key for link lookup (#36919)
Browse files Browse the repository at this point in the history
  • Loading branch information
dj12djdjs authored Sep 6, 2023
1 parent 174f95d commit 8ce6b81
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions erpnext/stock/report/stock_balance/stock_balance.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,10 @@ def apply_items_filters(self, query, item_table) -> str:
for field in ["item_code", "brand"]:
if not self.filters.get(field):
continue

query = query.where(item_table[field] == self.filters.get(field))
elif field == "item_code":
query = query.where(item_table.name == self.filters.get(field))
else:
query = query.where(item_table[field] == self.filters.get(field))

return query

Expand Down

0 comments on commit 8ce6b81

Please sign in to comment.