Skip to content

Commit

Permalink
fix: Add table alias in join queries to avoid ambiguous column errors…
Browse files Browse the repository at this point in the history
… for configurable reference column

(cherry picked from commit bf5267a)
  • Loading branch information
marination authored and mergify[bot] committed Dec 12, 2024
1 parent 6c544bc commit 87cb68d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -982,8 +982,8 @@ def get_si_matching_query(
"""
Get matching sales invoices when they are also used as payment entries (POS).
"""
si = frappe.qb.DocType("Sales Invoice")
sip = frappe.qb.DocType("Sales Invoice Payment")
si = frappe.qb.DocType("Sales Invoice").as_("si")
sip = frappe.qb.DocType("Sales Invoice Payment").as_("sip")

amount_equality = sip.amount == Parameter("%(amount)s")
amount_rank = frappe.qb.terms.Case().when(amount_equality, 1).else_(0)
Expand Down

0 comments on commit 87cb68d

Please sign in to comment.