revert: creation of customer from opportunity
This commit is contained in:
parent
c644fbb102
commit
5ad8afcc8d
@ -95,13 +95,6 @@ frappe.ui.form.on("Opportunity", {
|
|||||||
}, __('Create'));
|
}, __('Create'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (frm.doc.opportunity_from != "Customer") {
|
|
||||||
frm.add_custom_button(__('Customer'),
|
|
||||||
function() {
|
|
||||||
frm.trigger("make_customer")
|
|
||||||
}, __('Create'));
|
|
||||||
}
|
|
||||||
|
|
||||||
frm.add_custom_button(__('Quotation'),
|
frm.add_custom_button(__('Quotation'),
|
||||||
function() {
|
function() {
|
||||||
frm.trigger("create_quotation")
|
frm.trigger("create_quotation")
|
||||||
@ -203,13 +196,6 @@ erpnext.crm.Opportunity = class Opportunity extends frappe.ui.form.Controller {
|
|||||||
frm: cur_frm
|
frm: cur_frm
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
make_customer() {
|
|
||||||
frappe.model.open_mapped_doc({
|
|
||||||
method: "erpnext.crm.doctype.opportunity.opportunity.make_customer",
|
|
||||||
frm: cur_frm
|
|
||||||
})
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extend_cscript(cur_frm.cscript, new erpnext.crm.Opportunity({frm: cur_frm}));
|
extend_cscript(cur_frm.cscript, new erpnext.crm.Opportunity({frm: cur_frm}));
|
||||||
|
|||||||
@ -265,26 +265,6 @@ def make_quotation(source_name, target_doc=None):
|
|||||||
|
|
||||||
return doclist
|
return doclist
|
||||||
|
|
||||||
@frappe.whitelist()
|
|
||||||
def make_customer(source_name, target_doc=None):
|
|
||||||
def set_missing_values(source, target):
|
|
||||||
if source.opportunity_from == "Lead":
|
|
||||||
target.lead_name = source.party_name
|
|
||||||
if source.opportunity_from == "Prospect":
|
|
||||||
target.prospect = source.party_name
|
|
||||||
|
|
||||||
doclist = get_mapped_doc("Opportunity", source_name, {
|
|
||||||
"Opportunity": {
|
|
||||||
"doctype": "Customer",
|
|
||||||
"field_map": {
|
|
||||||
"currency": "default_currency",
|
|
||||||
"customer_name": "customer_name"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, target_doc, set_missing_values)
|
|
||||||
|
|
||||||
return doclist
|
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def make_request_for_quotation(source_name, target_doc=None):
|
def make_request_for_quotation(source_name, target_doc=None):
|
||||||
def update_item(obj, target, source_parent):
|
def update_item(obj, target, source_parent):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user