fix:Test record fixes

This commit is contained in:
deepeshgarg007
2019-04-08 12:28:50 +05:30
parent e2fc03e561
commit f094662f5e
3 changed files with 30 additions and 30 deletions

View File

@@ -5,6 +5,6 @@ from __future__ import unicode_literals
import frappe import frappe
def execute(): def execute():
frappe.reload_doctype("Quotation")
frappe.db.sql(""" UPDATE `tabQuotation` set customer_lead = lead WHERE quotation_to = 'Lead' """) frappe.db.sql(""" UPDATE `tabQuotation` set customer_lead = lead WHERE quotation_to = 'Lead' """)
frappe.db.sql(""" UPDATE `tabQuotation` set customer_lead = customer WHERE quotation_to = 'Customer' """) frappe.db.sql(""" UPDATE `tabQuotation` set customer_lead = customer WHERE quotation_to = 'Customer' """)

View File

@@ -3,7 +3,7 @@
"company": "_Test Company", "company": "_Test Company",
"conversion_rate": 1.0, "conversion_rate": 1.0,
"currency": "INR", "currency": "INR",
"customer": "_Test Customer", "customer_lead": "_Test Customer",
"customer_group": "_Test Customer Group", "customer_group": "_Test Customer Group",
"customer_name": "_Test Customer", "customer_name": "_Test Customer",
"doctype": "Quotation", "doctype": "Quotation",

View File

@@ -207,7 +207,7 @@ def _get_cart_quotation(party=None):
"status": "Draft", "status": "Draft",
"docstatus": 0, "docstatus": 0,
"__islocal": 1, "__islocal": 1,
(party.doctype.lower()): party.name "customer_lead": party.name
}) })
qdoc.contact_person = frappe.db.get_value("Contact", {"email_id": frappe.session.user}) qdoc.contact_person = frappe.db.get_value("Contact", {"email_id": frappe.session.user})
@@ -287,9 +287,9 @@ def _set_price_list(quotation, cart_settings):
# check if customer price list exists # check if customer price list exists
selling_price_list = None selling_price_list = None
if quotation.customer: if quotation.customer_lead:
from erpnext.accounts.party import get_default_price_list from erpnext.accounts.party import get_default_price_list
selling_price_list = get_default_price_list(frappe.get_doc("Customer", quotation.customer)) selling_price_list = get_default_price_list(frappe.get_doc("Customer", quotation.customer_lead))
# else check for territory based price list # else check for territory based price list
if not selling_price_list: if not selling_price_list:
@@ -301,9 +301,9 @@ def set_taxes(quotation, cart_settings):
"""set taxes based on billing territory""" """set taxes based on billing territory"""
from erpnext.accounts.party import set_taxes from erpnext.accounts.party import set_taxes
customer_group = frappe.db.get_value("Customer", quotation.customer, "customer_group") customer_group = frappe.db.get_value("Customer", quotation.customer_lead, "customer_group")
quotation.taxes_and_charges = set_taxes(quotation.customer, "Customer", \ quotation.taxes_and_charges = set_taxes(quotation.customer_lead, "Customer", \
quotation.transaction_date, quotation.company, customer_group, None, \ quotation.transaction_date, quotation.company, customer_group, None, \
quotation.customer_address, quotation.shipping_address_name, 1) quotation.customer_address, quotation.shipping_address_name, 1)
# #