fix: query for finding lost quotation (#19800)

* fix: query for finding lost quotation

* Update opportunity.py
This commit is contained in:
Pranav Nachnekar 2019-12-04 10:01:43 +00:00 committed by Nabin Hait
parent d285e9b7bd
commit 114e0db419

View File

@ -130,10 +130,10 @@ class Opportunity(TransactionBase):
def has_lost_quotation(self):
lost_quotation = frappe.db.sql("""
select q.name
from `tabQuotation` q, `tabQuotation Item` qi
where q.name = qi.parent and q.docstatus=1
and qi.prevdoc_docname =%s and q.status = 'Lost'
select name
from `tabQuotation`
where docstatus=1
and opportunity =%s and status = 'Lost'
""", self.name)
if lost_quotation:
if self.has_active_quotation():