mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-29 09:01:14 +02:00
feat: ability to create quotation against a prospect
(cherry picked from commit 47ce6de57d)
This commit is contained in:
@@ -647,12 +647,12 @@ def set_taxes(
|
|||||||
else:
|
else:
|
||||||
args.update(get_party_details(party, party_type))
|
args.update(get_party_details(party, party_type))
|
||||||
|
|
||||||
if party_type in ("Customer", "Lead"):
|
if party_type in ("Customer", "Lead", "Prospect"):
|
||||||
args.update({"tax_type": "Sales"})
|
args.update({"tax_type": "Sales"})
|
||||||
|
|
||||||
if party_type == "Lead":
|
if party_type in ["Lead", "Prospect"]:
|
||||||
args["customer"] = None
|
args["customer"] = None
|
||||||
del args["lead"]
|
del args[frappe.scrub(party_type)]
|
||||||
else:
|
else:
|
||||||
args.update({"tax_type": "Purchase"})
|
args.update({"tax_type": "Purchase"})
|
||||||
|
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ erpnext.utils.get_party_details = function(frm, method, args, callback) {
|
|||||||
|| (frm.doc.party_name && in_list(['Quotation', 'Opportunity'], frm.doc.doctype))) {
|
|| (frm.doc.party_name && in_list(['Quotation', 'Opportunity'], frm.doc.doctype))) {
|
||||||
|
|
||||||
let party_type = "Customer";
|
let party_type = "Customer";
|
||||||
if (frm.doc.quotation_to && frm.doc.quotation_to === "Lead") {
|
if (frm.doc.quotation_to && in_list(["Lead", "Prospect"], frm.doc.quotation_to)) {
|
||||||
party_type = "Lead";
|
party_type = frm.doc.quotation_to;
|
||||||
}
|
}
|
||||||
|
|
||||||
args = {
|
args = {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ frappe.ui.form.on('Quotation', {
|
|||||||
frm.set_query("quotation_to", function() {
|
frm.set_query("quotation_to", function() {
|
||||||
return{
|
return{
|
||||||
"filters": {
|
"filters": {
|
||||||
"name": ["in", ["Customer", "Lead"]],
|
"name": ["in", ["Customer", "Lead", "Prospect"]],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -160,19 +160,16 @@ erpnext.selling.QuotationController = class QuotationController extends erpnext.
|
|||||||
}
|
}
|
||||||
|
|
||||||
set_dynamic_field_label(){
|
set_dynamic_field_label(){
|
||||||
if (this.frm.doc.quotation_to == "Customer")
|
if (this.frm.doc.quotation_to == "Customer") {
|
||||||
{
|
|
||||||
this.frm.set_df_property("party_name", "label", "Customer");
|
this.frm.set_df_property("party_name", "label", "Customer");
|
||||||
this.frm.fields_dict.party_name.get_query = null;
|
this.frm.fields_dict.party_name.get_query = null;
|
||||||
}
|
} else if (this.frm.doc.quotation_to == "Lead") {
|
||||||
|
|
||||||
if (this.frm.doc.quotation_to == "Lead")
|
|
||||||
{
|
|
||||||
this.frm.set_df_property("party_name", "label", "Lead");
|
this.frm.set_df_property("party_name", "label", "Lead");
|
||||||
|
|
||||||
this.frm.fields_dict.party_name.get_query = function() {
|
this.frm.fields_dict.party_name.get_query = function() {
|
||||||
return{ query: "erpnext.controllers.queries.lead_query" }
|
return{ query: "erpnext.controllers.queries.lead_query" }
|
||||||
}
|
}
|
||||||
|
} else if (this.frm.doc.quotation_to == "Prospect") {
|
||||||
|
this.frm.set_df_property("party_name", "label", "Prospect");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user