mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-03 12:19:12 +00:00
[buying] started cleanup, [mapper] started rewrite
This commit is contained in:
@@ -154,8 +154,11 @@ class DocType(SellingController):
|
||||
super(DocType, self).validate()
|
||||
|
||||
import utilities
|
||||
utilities.validate_status(self.doc.status, ["Draft", "Submitted",
|
||||
"Order Confirmed", "Order Lost", "Cancelled"])
|
||||
if not self.doc.status:
|
||||
self.doc.status = "Draft"
|
||||
else:
|
||||
utilities.validate_status(self.doc.status, ["Draft", "Submitted",
|
||||
"Order Confirmed", "Order Lost", "Cancelled"])
|
||||
|
||||
self.validate_fiscal_year()
|
||||
self.set_last_contact_date()
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{
|
||||
"creation": "2013-05-24 19:29:08",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-07-03 16:12:44",
|
||||
"modified": "2013-07-04 10:56:10",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
@@ -114,7 +114,6 @@
|
||||
"read_only": 0
|
||||
},
|
||||
{
|
||||
"depends_on": "customer",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "customer_name",
|
||||
"fieldtype": "Data",
|
||||
|
||||
49
selling/doctype/quotation/test_quotation.py
Normal file
49
selling/doctype/quotation/test_quotation.py
Normal file
@@ -0,0 +1,49 @@
|
||||
import webnotes
|
||||
from webnotes.utils import flt
|
||||
import unittest
|
||||
|
||||
test_dependencies = ["Sales BOM"]
|
||||
|
||||
class TestLead(unittest.TestCase):
|
||||
def test_make_sales_order(self):
|
||||
lead = webnotes.bean("Lead", "_T-Lead-00001")
|
||||
lead.make_controller()
|
||||
customer = lead.controller.make_customer()
|
||||
self.assertEquals(customer[0].doctype, "Customer")
|
||||
self.assertEquals(customer[0].lead_name, lead.doc.name)
|
||||
webnotes.bean(customer).insert()
|
||||
|
||||
|
||||
test_records = [
|
||||
[
|
||||
{
|
||||
"company": "_Test Company",
|
||||
"conversion_rate": 1.0,
|
||||
"currency": "INR",
|
||||
"customer": "_Test Customer",
|
||||
"customer_name": "_Test Customer",
|
||||
"customer_group": "_Test Customer Group",
|
||||
"doctype": "Quotation",
|
||||
"fiscal_year": "_Test Fiscal Year 2013",
|
||||
"order_type": "Sales",
|
||||
"plc_conversion_rate": 1.0,
|
||||
"price_list_currency": "INR",
|
||||
"price_list_name": "_Test Price List",
|
||||
"territory": "_Test Territory",
|
||||
"transaction_date": "2013-02-21",
|
||||
"grand_total": 1000.0,
|
||||
"grand_total_export": 1000.0,
|
||||
},
|
||||
{
|
||||
"description": "CPU",
|
||||
"doctype": "Quotation Item",
|
||||
"item_code": "_Test Item Home Desktop 100",
|
||||
"item_name": "CPU",
|
||||
"parentfield": "quotation_details",
|
||||
"qty": 10.0,
|
||||
"basic_rate": 100.0,
|
||||
"export_rate": 100.0,
|
||||
"amount": 1000.0,
|
||||
}
|
||||
],
|
||||
]
|
||||
Reference in New Issue
Block a user