mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-22 06:29:20 +00:00
fix: Error fixed due to merging of lead/customer to party_name
This commit is contained in:
@@ -237,6 +237,10 @@ class AccountsController(TransactionBase):
|
|||||||
document_type = "{} Item".format(self.doctype)
|
document_type = "{} Item".format(self.doctype)
|
||||||
parent_dict.update({"document_type": document_type})
|
parent_dict.update({"document_type": document_type})
|
||||||
|
|
||||||
|
# party_name field used for customer in opportunity and quotation
|
||||||
|
if not parent_dict.get("customer") and parent_dict.get("party_name"):
|
||||||
|
parent_dict.update({"customer": parent_dict.get("party_name")})
|
||||||
|
|
||||||
for item in self.get("items"):
|
for item in self.get("items"):
|
||||||
if item.get("item_code"):
|
if item.get("item_code"):
|
||||||
args = parent_dict.copy()
|
args = parent_dict.copy()
|
||||||
|
|||||||
@@ -35,14 +35,14 @@ def get_data(filters):
|
|||||||
|
|
||||||
for lead in frappe.get_all('Lead', fields = ['name', 'lead_name', 'company_name'], filters=lead_filters):
|
for lead in frappe.get_all('Lead', fields = ['name', 'lead_name', 'company_name'], filters=lead_filters):
|
||||||
data = frappe.db.sql("""
|
data = frappe.db.sql("""
|
||||||
select
|
select
|
||||||
`tabCommunication`.reference_doctype, `tabCommunication`.reference_name,
|
`tabCommunication`.reference_doctype, `tabCommunication`.reference_name,
|
||||||
`tabCommunication`.content, `tabCommunication`.communication_date
|
`tabCommunication`.content, `tabCommunication`.communication_date
|
||||||
from
|
from
|
||||||
(
|
(
|
||||||
(select name, lead from `tabOpportunity` where lead = %(lead)s)
|
(select name, party_name as lead from `tabOpportunity` where opportunity_from='Lead' and party_name = %(lead)s)
|
||||||
union
|
union
|
||||||
(select name, lead from `tabQuotation` where lead = %(lead)s)
|
(select name, party_name as lead from `tabQuotation` where quotation_to = 'Lead' and party_name = %(lead)s)
|
||||||
union
|
union
|
||||||
(select name, lead from `tabIssue` where lead = %(lead)s and status!='Closed')
|
(select name, lead from `tabIssue` where lead = %(lead)s and status!='Closed')
|
||||||
union
|
union
|
||||||
|
|||||||
Reference in New Issue
Block a user