mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-06 05:39:12 +00:00
[cleanup] Removed Warehouse Type
This commit is contained in:
@@ -2,19 +2,16 @@ test_records = [
|
||||
[{
|
||||
"doctype": "Warehouse",
|
||||
"warehouse_name": "_Test Warehouse",
|
||||
"warehouse_type": "_Test Warehouse Type",
|
||||
"company": "_Test Company"
|
||||
}],
|
||||
[{
|
||||
"doctype": "Warehouse",
|
||||
"warehouse_name": "_Test Warehouse 1",
|
||||
"warehouse_type": "_Test Warehouse Type",
|
||||
"company": "_Test Company"
|
||||
}],
|
||||
[{
|
||||
"doctype": "Warehouse",
|
||||
"warehouse_name": "_Test Warehouse 2",
|
||||
"warehouse_type": "_Test Warehouse Type",
|
||||
"company": "_Test Company 1"
|
||||
}]
|
||||
]
|
||||
|
||||
@@ -47,15 +47,7 @@ class DocType:
|
||||
bin_obj = get_obj('Bin', bin)
|
||||
return bin_obj
|
||||
|
||||
|
||||
def validate_asset(self, item_code):
|
||||
if webnotes.conn.get_value("Item", item_code, "is_asset_item") == 'Yes' \
|
||||
and self.doc.warehouse_type != 'Fixed Asset':
|
||||
msgprint("""Fixed Asset Item %s can only be transacted in a
|
||||
Fixed Asset type Warehouse""" % item_code, raise_exception=1)
|
||||
|
||||
def update_bin(self, args):
|
||||
self.validate_asset(args.get("item_code"))
|
||||
is_stock_item = webnotes.conn.get_value('Item', args.get("item_code"), 'is_stock_item')
|
||||
if is_stock_item == 'Yes':
|
||||
bin = self.get_bin(args.get("item_code"))
|
||||
@@ -68,14 +60,7 @@ class DocType:
|
||||
def validate(self):
|
||||
if self.doc.email_id and not validate_email_add(self.doc.email_id):
|
||||
msgprint("Please enter valid Email Id", raise_exception=1)
|
||||
if not self.doc.warehouse_type:
|
||||
msgprint("Warehouse Type is Mandatory", raise_exception=1)
|
||||
|
||||
wt = sql("select warehouse_type from `tabWarehouse` where name ='%s'" % self.doc.name)
|
||||
if wt and cstr(self.doc.warehouse_type) != cstr(wt[0][0]):
|
||||
sql("""update `tabStock Ledger Entry` set warehouse_type = %s
|
||||
where warehouse = %s""", (self.doc.warehouse_type, self.doc.name))
|
||||
|
||||
|
||||
def merge_warehouses(self):
|
||||
webnotes.conn.auto_commit_on_many_writes = 1
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{
|
||||
"creation": "2013-03-07 18:50:32",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-07-05 15:02:12",
|
||||
"modified": "2013-07-10 18:37:24",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
@@ -14,8 +14,7 @@
|
||||
"document_type": "Master",
|
||||
"icon": "icon-building",
|
||||
"module": "Stock",
|
||||
"name": "__common__",
|
||||
"search_fields": "warehouse_type"
|
||||
"name": "__common__"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
@@ -57,19 +56,6 @@
|
||||
"permlevel": 0,
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "warehouse_type",
|
||||
"fieldtype": "Link",
|
||||
"in_filter": 1,
|
||||
"in_list_view": 1,
|
||||
"label": "Warehouse Type",
|
||||
"oldfieldname": "warehouse_type",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "Warehouse Type",
|
||||
"permlevel": 0,
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "company",
|
||||
@@ -80,12 +66,13 @@
|
||||
"oldfieldtype": "Link",
|
||||
"options": "Company",
|
||||
"permlevel": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "column_break_4",
|
||||
"fieldtype": "Column Break",
|
||||
"fieldtype": "Section Break",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user