fix: query for finding lost quotation (#19801)

* fix:query for finding lost quotation

* Update opportunity.py
This commit is contained in:
Pranav Nachnekar
2019-12-04 10:01:25 +00:00
committed by Nabin Hait
parent dc248b9458
commit d16ef54665
2 changed files with 5 additions and 5 deletions

View File

@@ -130,10 +130,11 @@ 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():

View File

@@ -67,7 +67,6 @@ class Quotation(SellingController):
opportunity = self.opportunity
opp = frappe.get_doc("Opportunity", opportunity)
opp.status = None
opp.set_status(update=True)
def declare_enquiry_lost(self, lost_reasons_list, detailed_reason=None):