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

@@ -1,36 +1,36 @@
[ [
{ {
"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",
"base_grand_total": 1000.0, "base_grand_total": 1000.0,
"grand_total": 1000.0, "grand_total": 1000.0,
"order_type": "Sales", "order_type": "Sales",
"plc_conversion_rate": 1.0, "plc_conversion_rate": 1.0,
"price_list_currency": "INR", "price_list_currency": "INR",
"items": [ "items": [
{ {
"base_amount": 1000.0, "base_amount": 1000.0,
"base_rate": 100.0, "base_rate": 100.0,
"description": "CPU", "description": "CPU",
"doctype": "Quotation Item", "doctype": "Quotation Item",
"item_code": "_Test Item Home Desktop 100", "item_code": "_Test Item Home Desktop 100",
"item_name": "CPU", "item_name": "CPU",
"parentfield": "items", "parentfield": "items",
"qty": 10.0, "qty": 10.0,
"rate": 100.0, "rate": 100.0,
"uom": "_Test UOM 1", "uom": "_Test UOM 1",
"stock_uom": "_Test UOM 1", "stock_uom": "_Test UOM 1",
"conversion_factor": 1.0 "conversion_factor": 1.0
} }
], ],
"quotation_to": "Customer", "quotation_to": "Customer",
"selling_price_list": "_Test Price List", "selling_price_list": "_Test Price List",
"territory": "_Test Territory", "territory": "_Test Territory",
"transaction_date": "2013-02-21", "transaction_date": "2013-02-21",
"valid_till": "2013-03-21" "valid_till": "2013-03-21"
} }

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)
# #