fix:Test record fixes
This commit is contained in:
@@ -5,6 +5,6 @@ from __future__ import unicode_literals
|
||||
import frappe
|
||||
|
||||
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 = customer WHERE quotation_to = 'Customer' """)
|
||||
@@ -1,36 +1,36 @@
|
||||
[
|
||||
{
|
||||
"company": "_Test Company",
|
||||
"conversion_rate": 1.0,
|
||||
"currency": "INR",
|
||||
"customer": "_Test Customer",
|
||||
"customer_group": "_Test Customer Group",
|
||||
"customer_name": "_Test Customer",
|
||||
"doctype": "Quotation",
|
||||
"base_grand_total": 1000.0,
|
||||
"grand_total": 1000.0,
|
||||
"order_type": "Sales",
|
||||
"plc_conversion_rate": 1.0,
|
||||
"price_list_currency": "INR",
|
||||
"company": "_Test Company",
|
||||
"conversion_rate": 1.0,
|
||||
"currency": "INR",
|
||||
"customer_lead": "_Test Customer",
|
||||
"customer_group": "_Test Customer Group",
|
||||
"customer_name": "_Test Customer",
|
||||
"doctype": "Quotation",
|
||||
"base_grand_total": 1000.0,
|
||||
"grand_total": 1000.0,
|
||||
"order_type": "Sales",
|
||||
"plc_conversion_rate": 1.0,
|
||||
"price_list_currency": "INR",
|
||||
"items": [
|
||||
{
|
||||
"base_amount": 1000.0,
|
||||
"base_rate": 100.0,
|
||||
"description": "CPU",
|
||||
"doctype": "Quotation Item",
|
||||
"item_code": "_Test Item Home Desktop 100",
|
||||
"item_name": "CPU",
|
||||
"parentfield": "items",
|
||||
"qty": 10.0,
|
||||
"base_amount": 1000.0,
|
||||
"base_rate": 100.0,
|
||||
"description": "CPU",
|
||||
"doctype": "Quotation Item",
|
||||
"item_code": "_Test Item Home Desktop 100",
|
||||
"item_name": "CPU",
|
||||
"parentfield": "items",
|
||||
"qty": 10.0,
|
||||
"rate": 100.0,
|
||||
"uom": "_Test UOM 1",
|
||||
"stock_uom": "_Test UOM 1",
|
||||
"conversion_factor": 1.0
|
||||
}
|
||||
],
|
||||
"quotation_to": "Customer",
|
||||
"selling_price_list": "_Test Price List",
|
||||
"territory": "_Test Territory",
|
||||
],
|
||||
"quotation_to": "Customer",
|
||||
"selling_price_list": "_Test Price List",
|
||||
"territory": "_Test Territory",
|
||||
"transaction_date": "2013-02-21",
|
||||
"valid_till": "2013-03-21"
|
||||
}
|
||||
|
||||
@@ -207,7 +207,7 @@ def _get_cart_quotation(party=None):
|
||||
"status": "Draft",
|
||||
"docstatus": 0,
|
||||
"__islocal": 1,
|
||||
(party.doctype.lower()): party.name
|
||||
"customer_lead": party.name
|
||||
})
|
||||
|
||||
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
|
||||
selling_price_list = None
|
||||
if quotation.customer:
|
||||
if quotation.customer_lead:
|
||||
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
|
||||
if not selling_price_list:
|
||||
@@ -301,9 +301,9 @@ def set_taxes(quotation, cart_settings):
|
||||
"""set taxes based on billing territory"""
|
||||
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.customer_address, quotation.shipping_address_name, 1)
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user