Fixed Make Sales Order from Quotation #1522

This commit is contained in:
Anand Doshi 2014-04-24 12:40:19 +05:30
parent 78eeacb53c
commit 8c62c40a3d
2 changed files with 263 additions and 260 deletions

View File

@ -78,7 +78,7 @@
"fieldtype": "Link",
"hidden": 0,
"in_filter": 1,
"label": "Group",
"label": "Customer Group",
"oldfieldname": "customer_group",
"oldfieldtype": "Link",
"options": "Customer Group",
@ -278,7 +278,7 @@
],
"icon": "icon-user",
"idx": 1,
"modified": "2014-03-03 19:05:58.000000",
"modified": "2014-03-03 19:06:00.000000",
"modified_by": "Administrator",
"module": "Selling",
"name": "Customer",

View File

@ -138,7 +138,8 @@ def _make_customer(source_name, ignore_permissions=False):
quotation = frappe.db.get_value("Quotation", source_name, ["lead", "order_type"])
if quotation and quotation[0]:
lead_name = quotation[0]
customer_name = frappe.db.get_value("Customer", {"lead_name": lead_name})
customer_name = frappe.db.get_value("Customer", {"lead_name": lead_name},
["name", "customer_name"], as_dict=True)
if not customer_name:
from erpnext.selling.doctype.lead.lead import _make_customer
customer_doclist = _make_customer(lead_name, ignore_permissions=ignore_permissions)
@ -162,3 +163,5 @@ def _make_customer(source_name, ignore_permissions=False):
except frappe.MandatoryError:
from frappe.utils import get_url_to_form
frappe.throw(_("Please create Customer from Lead {0}").format(lead_name))
else:
return customer_name