added some test records

This commit is contained in:
Anand Doshi
2013-02-07 19:47:34 +05:30
parent c39d13b6a7
commit 6209046772
20 changed files with 210 additions and 68 deletions

View File

@@ -220,4 +220,48 @@ class DocType:
if self.doc.slideshow:
from website.helpers.slideshow import get_slideshow
get_slideshow(self)
get_slideshow(self)
test_records = [
[{
"doctype": "Item",
"item_code": "_Test Item Home Desktop 100",
"item_name": "_Test Item Home Desktop 100",
"description": "_Test Item Home Desktop 100",
"item_group": "_Test Item Group Desktops",
"is_stock_item": "Yes",
"is_asset_item": "No",
"has_batch_no": "No",
"has_serial_no": "No",
"is_purchase_item": "Yes",
"is_sales_item": "Yes",
"is_service_item": "No",
"is_sample_item": "No",
"inspection_required": "No",
"is_pro_applicable": "No",
"is_sub_contracted_item": "No",
},
{
"doctype": "Item Tax",
"tax_type": "_Test Account Excise Duty - _TC",
"tax_rate": 10
}],
[{
"doctype": "Item",
"item_code": "_Test Item Home Desktop 200",
"item_name": "_Test Item Home Desktop 200",
"description": "_Test Item Home Desktop 200",
"item_group": "_Test Item Group Desktops",
"is_stock_item": "Yes",
"is_asset_item": "No",
"has_batch_no": "No",
"has_serial_no": "No",
"is_purchase_item": "Yes",
"is_sales_item": "Yes",
"is_service_item": "No",
"is_sample_item": "No",
"inspection_required": "No",
"is_pro_applicable": "No",
"is_sub_contracted_item": "No",
}],
]

View File

@@ -18,7 +18,6 @@ from __future__ import unicode_literals
import webnotes
from webnotes.utils import cstr, flt, validate_email_add
from webnotes.model.doc import Document
from webnotes.model.code import get_obj
from webnotes import msgprint
@@ -204,7 +203,15 @@ class DocType:
# delete cancelled sle
if sql("""select name from `tabStock Ledger Entry`
where warehouse = %s and ifnull('is_cancelled', '') = 'No'""", self.doc.name):
mdgprint("""Warehosue can not be deleted as stock ledger entry
exists for this warehosue.""", raise_exception=1)
msgprint("""Warehosue can not be deleted as stock ledger entry
exists for this warehouse.""", raise_exception=1)
else:
sql("delete from `tabStock Ledger Entry` where warehouse = %s", self.doc.name)
sql("delete from `tabStock Ledger Entry` where warehouse = %s", self.doc.name)
test_records = [
[{
"doctype": "Warehouse",
"warehouse_name": "_Test Warehouse",
"warehouse_type": "_Test Warehouse Type"
}]
]