mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-24 23:49:19 +00:00
fix: query for finding lost quotation (#19801)
* fix:query for finding lost quotation * Update opportunity.py
This commit is contained in:
committed by
Nabin Hait
parent
dc248b9458
commit
d16ef54665
@@ -130,10 +130,11 @@ class Opportunity(TransactionBase):
|
|||||||
|
|
||||||
def has_lost_quotation(self):
|
def has_lost_quotation(self):
|
||||||
lost_quotation = frappe.db.sql("""
|
lost_quotation = frappe.db.sql("""
|
||||||
select q.name
|
select name
|
||||||
from `tabQuotation` q, `tabQuotation Item` qi
|
from `tabQuotation`
|
||||||
where q.name = qi.parent and q.docstatus=1
|
where docstatus=1
|
||||||
and qi.prevdoc_docname =%s and q.status = 'Lost'
|
and opportunity =%s
|
||||||
|
and status = 'Lost'
|
||||||
""", self.name)
|
""", self.name)
|
||||||
if lost_quotation:
|
if lost_quotation:
|
||||||
if self.has_active_quotation():
|
if self.has_active_quotation():
|
||||||
|
|||||||
@@ -67,7 +67,6 @@ class Quotation(SellingController):
|
|||||||
opportunity = self.opportunity
|
opportunity = self.opportunity
|
||||||
|
|
||||||
opp = frappe.get_doc("Opportunity", opportunity)
|
opp = frappe.get_doc("Opportunity", opportunity)
|
||||||
opp.status = None
|
|
||||||
opp.set_status(update=True)
|
opp.set_status(update=True)
|
||||||
|
|
||||||
def declare_enquiry_lost(self, lost_reasons_list, detailed_reason=None):
|
def declare_enquiry_lost(self, lost_reasons_list, detailed_reason=None):
|
||||||
|
|||||||
Reference in New Issue
Block a user