fix: Test case fixes inquotation

This commit is contained in:
deepeshgarg007
2019-04-08 21:53:05 +05:30
parent f094662f5e
commit 7f7a1b48ed

View File

@@ -122,8 +122,8 @@ def _make_sales_order(source_name, target_doc=None, ignore_permissions=False):
def set_missing_values(source, target):
if customer:
target.customer = customer.name
target.customer_name = customer.customer_name
target.customer = customer
target.customer_name = customer
target.ignore_pricing_rule = 1
target.flags.ignore_permissions = ignore_permissions
target.run_method("set_missing_values")
@@ -169,8 +169,8 @@ def _make_sales_invoice(source_name, target_doc=None, ignore_permissions=False):
def set_missing_values(source, target):
if customer:
target.customer = customer.name
target.customer_name = customer.customer_name
target.customer = customer
target.customer_name = customer
target.ignore_pricing_rule = 1
target.flags.ignore_permissions = ignore_permissions
target.run_method("set_missing_values")
@@ -204,8 +204,8 @@ def _make_sales_invoice(source_name, target_doc=None, ignore_permissions=False):
return doclist
def _make_customer(source_name, ignore_permissions=False):
quotation = frappe.db.get_value("Quotation", source_name, ["order_type", "customer_lead"])
if quotation and quotation[1]:
quotation = frappe.db.get_value("Quotation", source_name, ["order_type", "customer_lead", "customer_name"])
if quotation and quotation[1] and not quotation[2]:
lead_name = quotation[1]
customer_name = frappe.db.get_value("Customer", {"lead_name": lead_name},
["name", "customer_name"], as_dict=True)
@@ -234,3 +234,5 @@ def _make_customer(source_name, ignore_permissions=False):
frappe.throw(_("Please create Customer from Lead {0}").format(lead_name))
else:
return customer_name
else:
return quotation[2]