Fixes in Lead, Opportunity, Quotation, Setup Wizard
This commit is contained in:
parent
f50a65294f
commit
78eeacb53c
@ -13,7 +13,7 @@ erpnext.utils.get_party_details = function(frm, method, args) {
|
|||||||
party_type: "Customer",
|
party_type: "Customer",
|
||||||
price_list: frm.doc.selling_price_list
|
price_list: frm.doc.selling_price_list
|
||||||
};
|
};
|
||||||
} else {
|
} else if(frm.doc.supplier) {
|
||||||
args = {
|
args = {
|
||||||
party: frm.doc.supplier,
|
party: frm.doc.supplier,
|
||||||
party_type: "Supplier",
|
party_type: "Supplier",
|
||||||
@ -21,6 +21,8 @@ erpnext.utils.get_party_details = function(frm, method, args) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(!args) return;
|
||||||
|
|
||||||
args.currency = frm.doc.currency;
|
args.currency = frm.doc.currency;
|
||||||
args.company = frm.doc.company;
|
args.company = frm.doc.company;
|
||||||
frappe.call({
|
frappe.call({
|
||||||
|
@ -101,7 +101,7 @@ def _make_customer(source_name, target_doc=None, ignore_permissions=False):
|
|||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def make_opportunity(source_name, target_doc=None):
|
def make_opportunity(source_name, target_doc=None):
|
||||||
doclist = get_mapped_doc("Lead", source_name,
|
target_doc = get_mapped_doc("Lead", source_name,
|
||||||
{"Lead": {
|
{"Lead": {
|
||||||
"doctype": "Opportunity",
|
"doctype": "Opportunity",
|
||||||
"field_map": {
|
"field_map": {
|
||||||
@ -115,7 +115,7 @@ def make_opportunity(source_name, target_doc=None):
|
|||||||
}
|
}
|
||||||
}}, target_doc)
|
}}, target_doc)
|
||||||
|
|
||||||
return doclist
|
return target_doc
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_lead_details(lead):
|
def get_lead_details(lead):
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"allow_import": 1,
|
"allow_import": 1,
|
||||||
"autoname": "naming_series:",
|
"autoname": "naming_series:",
|
||||||
"creation": "2013-03-07 18:50:30.000000",
|
"creation": "2013-03-07 18:50:30",
|
||||||
"description": "Potential Sales Deal",
|
"description": "Potential Sales Deal",
|
||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
@ -71,6 +71,15 @@
|
|||||||
"print_hide": 1,
|
"print_hide": 1,
|
||||||
"read_only": 0
|
"read_only": 0
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"depends_on": "eval:doc.customer || doc.lead",
|
||||||
|
"fieldname": "customer_name",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"label": "Customer / Lead Name",
|
||||||
|
"permlevel": 0,
|
||||||
|
"print_hide": 0,
|
||||||
|
"read_only": 1
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "column_break0",
|
"fieldname": "column_break0",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
@ -79,6 +88,17 @@
|
|||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"width": "50%"
|
"width": "50%"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "enquiry_type",
|
||||||
|
"fieldtype": "Select",
|
||||||
|
"label": "Opportunity Type",
|
||||||
|
"oldfieldname": "enquiry_type",
|
||||||
|
"oldfieldtype": "Select",
|
||||||
|
"options": "\nSales\nMaintenance",
|
||||||
|
"permlevel": 0,
|
||||||
|
"read_only": 0,
|
||||||
|
"reqd": 1
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"default": "Draft",
|
"default": "Draft",
|
||||||
"fieldname": "status",
|
"fieldname": "status",
|
||||||
@ -93,17 +113,6 @@
|
|||||||
"read_only": 1,
|
"read_only": 1,
|
||||||
"reqd": 1
|
"reqd": 1
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"fieldname": "enquiry_type",
|
|
||||||
"fieldtype": "Select",
|
|
||||||
"label": "Opportunity Type",
|
|
||||||
"oldfieldname": "enquiry_type",
|
|
||||||
"oldfieldtype": "Select",
|
|
||||||
"options": "\nSales\nMaintenance",
|
|
||||||
"permlevel": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"reqd": 1
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"fieldname": "items",
|
"fieldname": "items",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
@ -211,15 +220,6 @@
|
|||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"read_only": 0
|
"read_only": 0
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"depends_on": "customer",
|
|
||||||
"fieldname": "customer_name",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"label": "Customer Name",
|
|
||||||
"permlevel": 0,
|
|
||||||
"print_hide": 0,
|
|
||||||
"read_only": 1
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"depends_on": "eval:doc.lead || doc.customer",
|
"depends_on": "eval:doc.lead || doc.customer",
|
||||||
"fieldname": "contact_person",
|
"fieldname": "contact_person",
|
||||||
@ -409,7 +409,7 @@
|
|||||||
"icon": "icon-info-sign",
|
"icon": "icon-info-sign",
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"modified": "2014-01-20 17:48:59.000000",
|
"modified": "2014-04-23 06:38:48.858871",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Selling",
|
"module": "Selling",
|
||||||
"name": "Opportunity",
|
"name": "Opportunity",
|
||||||
|
@ -62,26 +62,34 @@ erpnext.selling.QuotationController = erpnext.selling.SellingController.extend({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
this.quotation_to();
|
this.toggle_reqd_lead_customer();
|
||||||
},
|
},
|
||||||
|
|
||||||
quotation_to: function() {
|
quotation_to: function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
this.frm.toggle_reqd("lead", this.frm.doc.quotation_to == "Lead");
|
|
||||||
this.frm.toggle_reqd("customer", this.frm.doc.quotation_to == "Customer");
|
|
||||||
if (this.frm.doc.quotation_to == "Lead") {
|
if (this.frm.doc.quotation_to == "Lead") {
|
||||||
this.frm.set_value("customer", null);
|
this.frm.set_value("customer", null);
|
||||||
this.frm.set_value("contact_person", null);
|
this.frm.set_value("contact_person", null);
|
||||||
|
} else if (this.frm.doc.quotation_to == "Customer") {
|
||||||
|
this.frm.set_value("lead", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.toggle_reqd_lead_customer();
|
||||||
|
},
|
||||||
|
|
||||||
|
toggle_reqd_lead_customer: function() {
|
||||||
|
var me = this;
|
||||||
|
|
||||||
|
this.frm.toggle_reqd("lead", this.frm.doc.quotation_to == "Lead");
|
||||||
|
this.frm.toggle_reqd("customer", this.frm.doc.quotation_to == "Customer");
|
||||||
|
|
||||||
// to overwrite the customer_filter trigger from queries.js
|
// to overwrite the customer_filter trigger from queries.js
|
||||||
$.each(["customer_address", "shipping_address_name"],
|
$.each(["customer_address", "shipping_address_name"],
|
||||||
function(i, opts) {
|
function(i, opts) {
|
||||||
me.frm.set_query(opts, erpnext.queries["lead_filter"]);
|
me.frm.set_query(opts, me.frm.doc.quotation_to==="Lead"
|
||||||
|
? erpnext.queries["lead_filter"] : erpnext.queries["customer_filter"]);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
|
||||||
else if (this.frm.doc.quotation_to == "Customer")
|
|
||||||
this.frm.set_value("lead", null);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
tc_name: function() {
|
tc_name: function() {
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"allow_attach": 1,
|
"allow_attach": 1,
|
||||||
"allow_import": 1,
|
"allow_import": 1,
|
||||||
"autoname": "naming_series:",
|
"autoname": "naming_series:",
|
||||||
"creation": "2013-05-24 19:29:08.000000",
|
"creation": "2013-05-24 19:29:08",
|
||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"document_type": "Transaction",
|
"document_type": "Transaction",
|
||||||
@ -83,7 +83,7 @@
|
|||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 1,
|
"hidden": 1,
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"label": "Customer Name",
|
"label": "Customer / Lead Name",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"read_only": 1
|
"read_only": 1
|
||||||
},
|
},
|
||||||
@ -818,7 +818,7 @@
|
|||||||
"idx": 1,
|
"idx": 1,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"max_attachments": 1,
|
"max_attachments": 1,
|
||||||
"modified": "2014-01-31 19:43:00.000000",
|
"modified": "2014-04-23 06:16:59.176080",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Selling",
|
"module": "Selling",
|
||||||
"name": "Quotation",
|
"name": "Quotation",
|
||||||
|
@ -204,9 +204,6 @@ def set_defaults(args):
|
|||||||
email_settings.send_print_in_body_and_attachment = 1
|
email_settings.send_print_in_body_and_attachment = 1
|
||||||
email_settings.save()
|
email_settings.save()
|
||||||
|
|
||||||
# default
|
|
||||||
frappe.db.set_default("company_name", args["company_name"])
|
|
||||||
|
|
||||||
def create_feed_and_todo():
|
def create_feed_and_todo():
|
||||||
"""update activty feed and create todo for creation of item, customer, vendor"""
|
"""update activty feed and create todo for creation of item, customer, vendor"""
|
||||||
from erpnext.home import make_feed
|
from erpnext.home import make_feed
|
||||||
|
Loading…
x
Reference in New Issue
Block a user