Merge branch 'develop' of github.com:frappe/erpnext into v4-hotfix
diff --git a/erpnext/accounts/doctype/account/account.json b/erpnext/accounts/doctype/account/account.json
index 05ac72f..cf9adc5 100644
--- a/erpnext/accounts/doctype/account/account.json
+++ b/erpnext/accounts/doctype/account/account.json
@@ -1,5 +1,6 @@
 {
  "allow_copy": 1, 
+ "allow_import": 1, 
  "allow_rename": 1, 
  "creation": "2013-01-30 12:49:46", 
  "description": "Heads (or groups) against which Accounting Entries are made and balances are maintained.", 
@@ -199,7 +200,7 @@
  "icon": "icon-money", 
  "idx": 1, 
  "in_create": 1, 
- "modified": "2014-05-07 05:33:30.500961", 
+ "modified": "2014-05-12 17:03:19.733139", 
  "modified_by": "Administrator", 
  "module": "Accounts", 
  "name": "Account", 
@@ -211,6 +212,8 @@
    "create": 1, 
    "delete": 1, 
    "email": 1, 
+   "export": 1, 
+   "import": 1, 
    "permlevel": 0, 
    "print": 1, 
    "read": 1, 
@@ -224,9 +227,9 @@
    "cancel": 0, 
    "create": 0, 
    "delete": 0, 
-   "email": 0, 
+   "email": 1, 
    "permlevel": 0, 
-   "print": 0, 
+   "print": 1, 
    "read": 1, 
    "report": 1, 
    "role": "Auditor", 
@@ -238,9 +241,9 @@
    "cancel": 0, 
    "create": 0, 
    "delete": 0, 
-   "email": 0, 
+   "email": 1, 
    "permlevel": 0, 
-   "print": 0, 
+   "print": 1, 
    "read": 1, 
    "report": 1, 
    "role": "Sales User", 
@@ -252,9 +255,9 @@
    "cancel": 0, 
    "create": 0, 
    "delete": 0, 
-   "email": 0, 
+   "email": 1, 
    "permlevel": 0, 
-   "print": 0, 
+   "print": 1, 
    "read": 1, 
    "report": 1, 
    "role": "Purchase User", 
@@ -262,11 +265,6 @@
    "write": 0
   }, 
   {
-   "permlevel": 0, 
-   "read": 1, 
-   "role": "Material User"
-  }, 
-  {
    "amend": 0, 
    "cancel": 0, 
    "create": 0, 
@@ -284,8 +282,8 @@
    "create": 1, 
    "delete": 1, 
    "email": 1, 
-   "export": 0, 
-   "import": 0, 
+   "export": 1, 
+   "import": 1, 
    "permlevel": 0, 
    "print": 1, 
    "read": 1, 
diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.json b/erpnext/accounts/doctype/pricing_rule/pricing_rule.json
index 2933ffa..baefde2 100644
--- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.json
+++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.json
@@ -1,4 +1,5 @@
 {
+ "allow_import": 1, 
  "autoname": "PRULE.#####", 
  "creation": "2014-02-21 15:02:51", 
  "docstatus": 0, 
@@ -202,7 +203,7 @@
  "icon": "icon-gift", 
  "idx": 1, 
  "istable": 0, 
- "modified": "2014-05-05 11:09:38.244111", 
+ "modified": "2014-05-12 16:24:52.005162", 
  "modified_by": "Administrator", 
  "module": "Accounts", 
  "name": "Pricing Rule", 
@@ -211,16 +212,23 @@
   {
    "create": 1, 
    "delete": 1, 
+   "export": 0, 
+   "import": 0, 
    "permlevel": 0, 
    "read": 1, 
+   "report": 1, 
    "role": "Accounts Manager", 
    "write": 1
   }, 
   {
    "create": 1, 
    "delete": 1, 
+   "export": 0, 
+   "import": 0, 
    "permlevel": 0, 
+   "print": 0, 
    "read": 1, 
+   "report": 1, 
    "role": "Sales Manager", 
    "write": 1
   }, 
@@ -229,6 +237,7 @@
    "delete": 1, 
    "permlevel": 0, 
    "read": 1, 
+   "report": 1, 
    "role": "Purchase Manager", 
    "write": 1
   }, 
@@ -237,16 +246,23 @@
    "delete": 1, 
    "permlevel": 0, 
    "read": 1, 
+   "report": 1, 
    "role": "Website Manager", 
    "write": 1
   }, 
   {
    "create": 1, 
    "delete": 1, 
+   "export": 1, 
+   "import": 1, 
    "permlevel": 0, 
    "read": 1, 
+   "report": 1, 
+   "restrict": 1, 
    "role": "System Manager", 
    "write": 1
   }
- ]
+ ], 
+ "sort_field": "modified", 
+ "sort_order": "DESC"
 }
\ No newline at end of file
diff --git a/erpnext/accounts/report/accounts_payable/accounts_payable.json b/erpnext/accounts/report/accounts_payable/accounts_payable.json
index 82c9337..fb210bd 100644
--- a/erpnext/accounts/report/accounts_payable/accounts_payable.json
+++ b/erpnext/accounts/report/accounts_payable/accounts_payable.json
@@ -1,11 +1,11 @@
 {
  "add_total_row": 1, 
- "creation": "2013-04-22 16:16:03.000000", 
+ "creation": "2013-04-22 16:16:03", 
  "docstatus": 0, 
  "doctype": "Report", 
  "idx": 1, 
  "is_standard": "Yes", 
- "modified": "2014-03-07 15:30:27.000000", 
+ "modified": "2014-05-12 17:18:09.605534", 
  "modified_by": "Administrator", 
  "module": "Accounts", 
  "name": "Accounts Payable", 
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index 57b7599..f967363 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -1,42 +1,43 @@
 execute:import unidecode # new requirement
 
-erpnext.patches.4_0.validate_v3_patch
-erpnext.patches.4_0.update_user_properties
-erpnext.patches.4_0.move_warehouse_user_to_restrictions
-erpnext.patches.4_0.new_permissions
-erpnext.patches.4_0.update_incharge_name_to_sales_person_in_maintenance_schedule
+erpnext.patches.v4_0.validate_v3_patch
+execute:frappe.db.sql("""update `tabPatch Log` set patch=replace(patch, '4_0', 'v4_0')""")
+erpnext.patches.v4_0.update_user_properties
+erpnext.patches.v4_0.move_warehouse_user_to_restrictions
+erpnext.patches.v4_0.new_permissions
+erpnext.patches.v4_0.update_incharge_name_to_sales_person_in_maintenance_schedule
 execute:frappe.reload_doc('accounts', 'doctype', 'sales_invoice') # 2014-01-29
 execute:frappe.reload_doc('selling', 'doctype', 'sales_order') # 2014-01-29
 execute:frappe.reload_doc('selling', 'doctype', 'quotation') # 2014-01-29
 execute:frappe.reload_doc('stock', 'doctype', 'delivery_note') # 2014-01-29
-erpnext.patches.4_0.reload_sales_print_format
+erpnext.patches.v4_0.reload_sales_print_format
 execute:frappe.reload_doc('accounts', 'doctype', 'purchase_invoice') # 2014-01-29
 execute:frappe.reload_doc('buying', 'doctype', 'purchase_order') # 2014-01-29
 execute:frappe.reload_doc('buying', 'doctype', 'supplier_quotation') # 2014-01-29
 execute:frappe.reload_doc('stock', 'doctype', 'purchase_receipt') # 2014-01-29
-erpnext.patches.4_0.reload_purchase_print_format
+erpnext.patches.v4_0.reload_purchase_print_format
 execute:frappe.reload_doc('accounts', 'doctype', 'pos_setting') # 2014-01-29
 execute:frappe.reload_doc('selling', 'doctype', 'customer') # 2014-01-29
 execute:frappe.reload_doc('buying', 'doctype', 'supplier') # 2014-01-29
-erpnext.patches.4_0.map_charge_to_taxes_and_charges
+erpnext.patches.v4_0.map_charge_to_taxes_and_charges
 execute:frappe.reload_doc('support', 'doctype', 'newsletter') # 2014-01-31
 execute:frappe.reload_doc('hr', 'doctype', 'employee') # 2014-02-03
 execute:frappe.db.sql("update tabPage set module='Core' where name='Setup'")
-erpnext.patches.4_0.fields_to_be_renamed
-erpnext.patches.4_0.rename_sitemap_to_route
-erpnext.patches.4_0.fix_contact_address
-erpnext.patches.4_0.customer_discount_to_pricing_rule
+erpnext.patches.v4_0.fields_to_be_renamed
+erpnext.patches.v4_0.rename_sitemap_to_route
+erpnext.patches.v4_0.fix_contact_address
+erpnext.patches.v4_0.customer_discount_to_pricing_rule
 execute:frappe.db.sql("""delete from `tabWebsite Item Group` where ifnull(item_group, '')=''""")
-erpnext.patches.4_0.remove_module_home_pages
-erpnext.patches.4_0.split_email_settings
-erpnext.patches.4_0.fix_employee_user_id
-erpnext.patches.4_0.import_country_codes
-erpnext.patches.4_0.countrywise_coa
+erpnext.patches.v4_0.remove_module_home_pages
+erpnext.patches.v4_0.split_email_settings
+erpnext.patches.v4_0.fix_employee_user_id
+erpnext.patches.v4_0.import_country_codes
+erpnext.patches.v4_0.countrywise_coa
 execute:frappe.delete_doc("DocType", "MIS Control")
 execute:frappe.delete_doc("Page", "Financial Statements")
 execute:frappe.delete_doc("DocType", "Stock Ledger")
 execute:frappe.db.sql("update `tabJournal Voucher` set voucher_type='Journal Entry' where ifnull(voucher_type, '')=''")
 execute:frappe.delete_doc("DocType", "Grade")
-erpnext.patches.4_0.remove_india_specific_fields
+erpnext.patches.v4_0.remove_india_specific_fields
 execute:frappe.delete_doc_if_exists("DocType", "Warehouse User")
 execute:frappe.db.sql("delete from `tabWebsite Item Group` where ifnull(item_group, '')=''")
diff --git a/erpnext/patches/4_0/fields_to_be_renamed.py b/erpnext/patches/4_0/fields_to_be_renamed.py
deleted file mode 100644
index 2bbd430..0000000
--- a/erpnext/patches/4_0/fields_to_be_renamed.py
+++ /dev/null
@@ -1,131 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-import frappe
-from frappe.model import rename_field
-from frappe.modules import scrub, get_doctype_module
-
-def execute():
-	rename_map = {
-		"Quotation Item": [
-			["ref_rate", "price_list_rate"], 
-			["base_ref_rate", "base_price_list_rate"],
-			["adj_rate", "discount_percentage"], 
-			["export_rate", "rate"], 
-			["basic_rate", "base_rate"], 
-			["amount", "base_amount"], 
-			["export_amount", "amount"]
-		],
-		
-		"Sales Order Item": [
-			["ref_rate", "price_list_rate"], 
-			["base_ref_rate", "base_price_list_rate"],
-			["adj_rate", "discount_percentage"], 
-			["export_rate", "rate"], 
-			["basic_rate", "base_rate"], 
-			["amount", "base_amount"], 
-			["export_amount", "amount"], 
-			["reserved_warehouse", "warehouse"]
-		],
-		
-		"Delivery Note Item": [
-			["ref_rate", "price_list_rate"], 
-			["base_ref_rate", "base_price_list_rate"], 
-			["adj_rate", "discount_percentage"], 
-			["export_rate", "rate"], 
-			["basic_rate", "base_rate"], 
-			["amount", "base_amount"], 
-			["export_amount", "amount"]
-		],
-
-		"Sales Invoice Item": [
-			["ref_rate", "price_list_rate"], 
-			["base_ref_rate", "base_price_list_rate"], 
-			["adj_rate", "discount_percentage"], 
-			["export_rate", "rate"], 
-			["basic_rate", "base_rate"], 
-			["amount", "base_amount"], 
-			["export_amount", "amount"]
-		],
-
-		"Supplier Quotation Item": [
-			["import_ref_rate", "price_list_rate"], 
-			["purchase_ref_rate", "base_price_list_rate"], 
-			["discount_rate", "discount_percentage"], 
-			["import_rate", "rate"], 
-			["purchase_rate", "base_rate"], 
-			["amount", "base_amount"], 
-			["import_amount", "amount"]
-		],
-	
-		"Purchase Order Item": [
-			["import_ref_rate", "price_list_rate"], 
-			["purchase_ref_rate", "base_price_list_rate"], 
-			["discount_rate", "discount_percentage"], 
-			["import_rate", "rate"], 
-			["purchase_rate", "base_rate"], 
-			["amount", "base_amount"], 
-			["import_amount", "amount"]
-		],
-	
-		"Purchase Receipt Item": [
-			["import_ref_rate", "price_list_rate"], 
-			["purchase_ref_rate", "base_price_list_rate"], 
-			["discount_rate", "discount_percentage"], 
-			["import_rate", "rate"], 
-			["purchase_rate", "base_rate"], 
-			["amount", "base_amount"], 
-			["import_amount", "amount"]
-		],
-		
-		"Purchase Invoice Item": [
-			["import_ref_rate", "price_list_rate"], 
-			["purchase_ref_rate", "base_price_list_rate"], 
-			["discount_rate", "discount_percentage"], 
-			["import_rate", "rate"], 
-			["rate", "base_rate"], 
-			["amount", "base_amount"], 
-			["import_amount", "amount"], 
-			["expense_head", "expense_account"]
-		],
-		
-		"Item": [
-			["purchase_account", "expense_account"],
-			["default_sales_cost_center", "selling_cost_center"],
-			["cost_center", "buying_cost_center"],
-			["default_income_account", "income_account"],
-		],
-		"Item Price": [
-			["ref_rate", "price_list_rate"]
-		]
-	}
-
-	reload_docs(rename_map)
-	
-	for dt, field_list in rename_map.items():
-		for field in field_list:
-			rename_field(dt, field[0], field[1])
-			
-def reload_docs(docs):
-	for dn in docs:
-		frappe.reload_doc(get_doctype_module(dn), "doctype", scrub(dn))
-	
-	# reload all standard print formats
-	for pf in frappe.db.sql("""select name, module from `tabPrint Format` 
-			where ifnull(standard, 'No') = 'Yes'""", as_dict=1):
-		try:
-			frappe.reload_doc(pf.module, "Print Format", pf.name)
-		except Exception, e:
-			print e
-			pass
-		
-	# reload all standard reports
-	for r in frappe.db.sql("""select name, ref_doctype from `tabReport` 
-		where ifnull(is_standard, 'No') = 'Yes'
-		and report_type in ('Report Builder', 'Query Report')""", as_dict=1):
-			try:
-				frappe.reload_doc(get_doctype_module(r.ref_doctype), "Report", r.name)
-			except Exception, e:
-				print e
-				pass
diff --git a/erpnext/patches/4_0/__init__.py b/erpnext/patches/v4_0/__init__.py
similarity index 100%
rename from erpnext/patches/4_0/__init__.py
rename to erpnext/patches/v4_0/__init__.py
diff --git a/erpnext/patches/4_0/countrywise_coa.py b/erpnext/patches/v4_0/countrywise_coa.py
similarity index 100%
rename from erpnext/patches/4_0/countrywise_coa.py
rename to erpnext/patches/v4_0/countrywise_coa.py
diff --git a/erpnext/patches/4_0/customer_discount_to_pricing_rule.py b/erpnext/patches/v4_0/customer_discount_to_pricing_rule.py
similarity index 100%
rename from erpnext/patches/4_0/customer_discount_to_pricing_rule.py
rename to erpnext/patches/v4_0/customer_discount_to_pricing_rule.py
diff --git a/erpnext/patches/v4_0/fields_to_be_renamed.py b/erpnext/patches/v4_0/fields_to_be_renamed.py
new file mode 100644
index 0000000..b2f42f1
--- /dev/null
+++ b/erpnext/patches/v4_0/fields_to_be_renamed.py
@@ -0,0 +1,131 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe.model import rename_field
+from frappe.modules import scrub, get_doctype_module
+
+rename_map = {
+	"Quotation Item": [
+		["ref_rate", "price_list_rate"],
+		["base_ref_rate", "base_price_list_rate"],
+		["adj_rate", "discount_percentage"],
+		["export_rate", "rate"],
+		["basic_rate", "base_rate"],
+		["amount", "base_amount"],
+		["export_amount", "amount"]
+	],
+
+	"Sales Order Item": [
+		["ref_rate", "price_list_rate"],
+		["base_ref_rate", "base_price_list_rate"],
+		["adj_rate", "discount_percentage"],
+		["export_rate", "rate"],
+		["basic_rate", "base_rate"],
+		["amount", "base_amount"],
+		["export_amount", "amount"],
+		["reserved_warehouse", "warehouse"]
+	],
+
+	"Delivery Note Item": [
+		["ref_rate", "price_list_rate"],
+		["base_ref_rate", "base_price_list_rate"],
+		["adj_rate", "discount_percentage"],
+		["export_rate", "rate"],
+		["basic_rate", "base_rate"],
+		["amount", "base_amount"],
+		["export_amount", "amount"]
+	],
+
+	"Sales Invoice Item": [
+		["ref_rate", "price_list_rate"],
+		["base_ref_rate", "base_price_list_rate"],
+		["adj_rate", "discount_percentage"],
+		["export_rate", "rate"],
+		["basic_rate", "base_rate"],
+		["amount", "base_amount"],
+		["export_amount", "amount"]
+	],
+
+	"Supplier Quotation Item": [
+		["import_ref_rate", "price_list_rate"],
+		["purchase_ref_rate", "base_price_list_rate"],
+		["discount_rate", "discount_percentage"],
+		["import_rate", "rate"],
+		["purchase_rate", "base_rate"],
+		["amount", "base_amount"],
+		["import_amount", "amount"]
+	],
+
+	"Purchase Order Item": [
+		["import_ref_rate", "price_list_rate"],
+		["purchase_ref_rate", "base_price_list_rate"],
+		["discount_rate", "discount_percentage"],
+		["import_rate", "rate"],
+		["purchase_rate", "base_rate"],
+		["amount", "base_amount"],
+		["import_amount", "amount"]
+	],
+
+	"Purchase Receipt Item": [
+		["import_ref_rate", "price_list_rate"],
+		["purchase_ref_rate", "base_price_list_rate"],
+		["discount_rate", "discount_percentage"],
+		["import_rate", "rate"],
+		["purchase_rate", "base_rate"],
+		["amount", "base_amount"],
+		["import_amount", "amount"]
+	],
+
+	"Purchase Invoice Item": [
+		["import_ref_rate", "price_list_rate"],
+		["purchase_ref_rate", "base_price_list_rate"],
+		["discount_rate", "discount_percentage"],
+		["import_rate", "rate"],
+		["rate", "base_rate"],
+		["amount", "base_amount"],
+		["import_amount", "amount"],
+		["expense_head", "expense_account"]
+	],
+
+	"Item": [
+		["purchase_account", "expense_account"],
+		["default_sales_cost_center", "selling_cost_center"],
+		["cost_center", "buying_cost_center"],
+		["default_income_account", "income_account"],
+	],
+	"Item Price": [
+		["ref_rate", "price_list_rate"]
+	]
+}
+
+def execute():
+	reload_docs()
+
+	for dt, field_list in rename_map.items():
+		for field in field_list:
+			rename_field(dt, field[0], field[1])
+
+def reload_docs():
+	for dn in rename_map:
+		frappe.reload_doc(get_doctype_module(dn), "doctype", scrub(dn))
+
+	# reload all standard print formats
+	for pf in frappe.db.sql("""select name, module from `tabPrint Format`
+			where ifnull(standard, 'No') = 'Yes'""", as_dict=1):
+		try:
+			frappe.reload_doc(pf.module, "Print Format", pf.name)
+		except Exception, e:
+			print e
+			pass
+
+	# reload all standard reports
+	for r in frappe.db.sql("""select name, ref_doctype from `tabReport`
+		where ifnull(is_standard, 'No') = 'Yes'
+		and report_type in ('Report Builder', 'Query Report')""", as_dict=1):
+			try:
+				frappe.reload_doc(get_doctype_module(r.ref_doctype), "report", r.name)
+			except Exception, e:
+				print e
+				pass
diff --git a/erpnext/patches/4_0/fix_contact_address.py b/erpnext/patches/v4_0/fix_contact_address.py
similarity index 100%
rename from erpnext/patches/4_0/fix_contact_address.py
rename to erpnext/patches/v4_0/fix_contact_address.py
diff --git a/erpnext/patches/4_0/fix_employee_user_id.py b/erpnext/patches/v4_0/fix_employee_user_id.py
similarity index 100%
rename from erpnext/patches/4_0/fix_employee_user_id.py
rename to erpnext/patches/v4_0/fix_employee_user_id.py
diff --git a/erpnext/patches/4_0/import_country_codes.py b/erpnext/patches/v4_0/import_country_codes.py
similarity index 100%
rename from erpnext/patches/4_0/import_country_codes.py
rename to erpnext/patches/v4_0/import_country_codes.py
diff --git a/erpnext/patches/4_0/map_charge_to_taxes_and_charges.py b/erpnext/patches/v4_0/map_charge_to_taxes_and_charges.py
similarity index 100%
rename from erpnext/patches/4_0/map_charge_to_taxes_and_charges.py
rename to erpnext/patches/v4_0/map_charge_to_taxes_and_charges.py
diff --git a/erpnext/patches/4_0/move_warehouse_user_to_restrictions.py b/erpnext/patches/v4_0/move_warehouse_user_to_restrictions.py
similarity index 100%
rename from erpnext/patches/4_0/move_warehouse_user_to_restrictions.py
rename to erpnext/patches/v4_0/move_warehouse_user_to_restrictions.py
diff --git a/erpnext/patches/4_0/new_permissions.py b/erpnext/patches/v4_0/new_permissions.py
similarity index 100%
rename from erpnext/patches/4_0/new_permissions.py
rename to erpnext/patches/v4_0/new_permissions.py
diff --git a/erpnext/patches/4_0/reload_purchase_print_format.py b/erpnext/patches/v4_0/reload_purchase_print_format.py
similarity index 100%
rename from erpnext/patches/4_0/reload_purchase_print_format.py
rename to erpnext/patches/v4_0/reload_purchase_print_format.py
diff --git a/erpnext/patches/4_0/reload_sales_print_format.py b/erpnext/patches/v4_0/reload_sales_print_format.py
similarity index 100%
rename from erpnext/patches/4_0/reload_sales_print_format.py
rename to erpnext/patches/v4_0/reload_sales_print_format.py
diff --git a/erpnext/patches/4_0/remove_india_specific_fields.py b/erpnext/patches/v4_0/remove_india_specific_fields.py
similarity index 100%
rename from erpnext/patches/4_0/remove_india_specific_fields.py
rename to erpnext/patches/v4_0/remove_india_specific_fields.py
diff --git a/erpnext/patches/4_0/remove_module_home_pages.py b/erpnext/patches/v4_0/remove_module_home_pages.py
similarity index 100%
rename from erpnext/patches/4_0/remove_module_home_pages.py
rename to erpnext/patches/v4_0/remove_module_home_pages.py
diff --git a/erpnext/patches/4_0/rename_sitemap_to_route.py b/erpnext/patches/v4_0/rename_sitemap_to_route.py
similarity index 100%
rename from erpnext/patches/4_0/rename_sitemap_to_route.py
rename to erpnext/patches/v4_0/rename_sitemap_to_route.py
diff --git a/erpnext/patches/4_0/split_email_settings.py b/erpnext/patches/v4_0/split_email_settings.py
similarity index 100%
rename from erpnext/patches/4_0/split_email_settings.py
rename to erpnext/patches/v4_0/split_email_settings.py
diff --git a/erpnext/patches/4_0/update_incharge_name_to_sales_person_in_maintenance_schedule.py b/erpnext/patches/v4_0/update_incharge_name_to_sales_person_in_maintenance_schedule.py
similarity index 100%
rename from erpnext/patches/4_0/update_incharge_name_to_sales_person_in_maintenance_schedule.py
rename to erpnext/patches/v4_0/update_incharge_name_to_sales_person_in_maintenance_schedule.py
diff --git a/erpnext/patches/4_0/update_user_properties.py b/erpnext/patches/v4_0/update_user_properties.py
similarity index 100%
rename from erpnext/patches/4_0/update_user_properties.py
rename to erpnext/patches/v4_0/update_user_properties.py
diff --git a/erpnext/patches/4_0/validate_v3_patch.py b/erpnext/patches/v4_0/validate_v3_patch.py
similarity index 100%
rename from erpnext/patches/4_0/validate_v3_patch.py
rename to erpnext/patches/v4_0/validate_v3_patch.py
diff --git a/erpnext/stock/report/serial_no_status/serial_no_status.json b/erpnext/stock/report/serial_no_status/serial_no_status.json
index 047259c..a123033 100644
--- a/erpnext/stock/report/serial_no_status/serial_no_status.json
+++ b/erpnext/stock/report/serial_no_status/serial_no_status.json
@@ -1,11 +1,11 @@
 {
- "creation": "2013-01-14 10:52:58.000000", 
+ "creation": "2013-01-14 10:52:58", 
  "docstatus": 0, 
  "doctype": "Report", 
  "idx": 1, 
  "is_standard": "Yes", 
- "json": "{\"filters\":[],\"columns\":[[\"name\",\"Serial No\"],[\"item_code\",\"Serial No\"],[\"warehouse\",\"Serial No\"],[\"status\",\"Serial No\"],[\"item_name\",\"Serial No\"],[\"description\",\"Serial No\"],[\"item_group\",\"Serial No\"],[\"brand\",\"Serial No\"],[\"purchase_document_no\",\"Serial No\"],[\"purchase_date\",\"Serial No\"],[\"customer\",\"Serial No\"],[\"customer_name\",\"Serial No\"],[\"purchase_rate\",\"Serial No\"],[\"delivery_document_no\",\"Serial No\"],[\"delivery_date\",\"Serial No\"],[\"supplier\",\"Serial No\"],[\"supplier_name\",\"Serial No\"]],\"sort_by\":\"Serial No.name\",\"sort_order\":\"desc\",\"sort_by_next\":\"\",\"sort_order_next\":\"desc\"}", 
- "modified": "2014-03-07 15:30:27.000000", 
+ "json": "{\"sort_by\": \"Serial No.name\", \"sort_order\": \"desc\", \"sort_by_next\": \"\", \"filters\": [], \"sort_order_next\": \"desc\", \"columns\": [[\"name\", \"Serial No\"], [\"item_code\", \"Serial No\"], [\"warehouse\", \"Serial No\"], [\"status\", \"Serial No\"], [\"item_name\", \"Serial No\"], [\"description\", \"Serial No\"], [\"item_group\", \"Serial No\"], [\"brand\", \"Serial No\"], [\"purchase_document_no\", \"Serial No\"], [\"purchase_date\", \"Serial No\"], [\"customer\", \"Serial No\"], [\"customer_name\", \"Serial No\"], [\"purchase_rate\", \"Serial No\"], [\"delivery_document_no\", \"Serial No\"], [\"delivery_date\", \"Serial No\"], [\"supplier\", \"Serial No\"], [\"supplier_name\", \"Serial No\"]]}", 
+ "modified": "2014-05-12 17:39:07.549646", 
  "modified_by": "Administrator", 
  "module": "Stock", 
  "name": "Serial No Status",