Skip to content

Commit

Permalink
fix: use primary key for link lookup (backport #36919) (#36978)
Browse files Browse the repository at this point in the history
fix: use primary key for link lookup (#36919)

(cherry picked from commit 8ce6b81)

Co-authored-by: Devin Slauenwhite <[email protected]>
  • Loading branch information
mergify[bot] and dj12djdjs authored Sep 6, 2023
1 parent 58163d5 commit 4fede56
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 @@ -323,8 +323,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 4fede56

Please sign in to comment.