Merge branch 'handlerupdate' of github.com:webnotes/erpnext into handlerupdate
diff --git a/css/all-app.css b/css/all-app.css
index f706a03..fad5701 100644
--- a/css/all-app.css
+++ b/css/all-app.css
@@ -26,12 +26,15 @@
 }
 
 select, input, textarea { 
-	border: 1px solid #AAA; 
+	border: 1px solid #ccc; 
 	-moz-border-radius: 4px;
 	-webkit-border-radius: 4px;
 	font-size: 13px;
 	padding: 4px;
-	color: #222;
+	color: #444;
+	-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+	-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+	box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
 }
 
 textarea { 
@@ -299,6 +302,18 @@
  */
 /* FORMS */
 
+div.form-section-break {
+	margin: 15px 0px 3px 0px;
+}
+
+div.form-section-break h3 {
+	line-height: 20px;
+}
+
+div.form-section-break hr {
+	margin: 9px 0px;
+}
+
 
 div.frm_print_wrapper {
 	background-color:#FFF;
@@ -442,9 +457,9 @@
 
 
 .field_description, .help {
-	margin: 3px 0px 11px 0px;
+	margin: 3px 0px;
+	font-size: 11px;
 	color: #888;
-	font-style: italic;
 }
 
 .field_description_top {
diff --git a/css/all-web.css b/css/all-web.css
index ceb6d9c..5843385 100644
--- a/css/all-web.css
+++ b/css/all-web.css
@@ -26,12 +26,15 @@
 }
 
 select, input, textarea { 
-	border: 1px solid #AAA; 
+	border: 1px solid #ccc; 
 	-moz-border-radius: 4px;
 	-webkit-border-radius: 4px;
 	font-size: 13px;
 	padding: 4px;
-	color: #222;
+	color: #444;
+	-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+	-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+	box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
 }
 
 textarea { 
diff --git a/erpnext/patches/before_jan_2012/Discount_purchase_cycle.py b/erpnext/patches/before_jan_2012/Discount_purchase_cycle.py
index 8fee8c5..9f0a5c0 100644
--- a/erpnext/patches/before_jan_2012/Discount_purchase_cycle.py
+++ b/erpnext/patches/before_jan_2012/Discount_purchase_cycle.py
@@ -16,7 +16,7 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 
 	reload_doc('accounts', 'doctype', 'pv_detail')
 	reload_doc('buying', 'doctype', 'po_detail')
diff --git a/erpnext/patches/before_jan_2012/accounts_default_form.py b/erpnext/patches/before_jan_2012/accounts_default_form.py
index 282ebf5..eb8f586 100644
--- a/erpnext/patches/before_jan_2012/accounts_default_form.py
+++ b/erpnext/patches/before_jan_2012/accounts_default_form.py
@@ -16,7 +16,7 @@
 
 def execute():
         import webnotes
-        from webnotes.modules.module_manager import reload_doc
+        from webnotes.modules import reload_doc
         reload_doc('setup', 'doctype', 'company')
         reload_doc('setup', 'doctype', 'manage_account')
  
diff --git a/erpnext/patches/before_jan_2012/auto_indent.py b/erpnext/patches/before_jan_2012/auto_indent.py
index 7373c39..a472d80 100644
--- a/erpnext/patches/before_jan_2012/auto_indent.py
+++ b/erpnext/patches/before_jan_2012/auto_indent.py
@@ -16,7 +16,7 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('setup', 'doctype', 'manage_account')
 	reload_doc('stock', 'doctype', 'item')
 	webnotes.conn.sql("delete from `tabDocField` where fieldname='minimum_inventory_level' and parent='item'")
diff --git a/erpnext/patches/before_jan_2012/c_form_patch.py b/erpnext/patches/before_jan_2012/c_form_patch.py
index 8c00891..307dabc 100644
--- a/erpnext/patches/before_jan_2012/c_form_patch.py
+++ b/erpnext/patches/before_jan_2012/c_form_patch.py
@@ -16,7 +16,7 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 
 	reload_doc('accounts', 'doctype', 'receivable_voucher')
 	reload_doc('accounts', 'doctype', 'c_form')
diff --git a/erpnext/patches/before_jan_2012/deploy_email_digest.py b/erpnext/patches/before_jan_2012/deploy_email_digest.py
index 5adeb97..8474b64 100644
--- a/erpnext/patches/before_jan_2012/deploy_email_digest.py
+++ b/erpnext/patches/before_jan_2012/deploy_email_digest.py
@@ -21,7 +21,7 @@
 		* Reload email_digest doctype
 		* Create default email digest
 	"""
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	
 	# Minor fix in print_format doctype
 	#reload_doc('core', 'doctype', 'print_format')
diff --git a/erpnext/patches/before_jan_2012/employeewise_balance_leave_report.py b/erpnext/patches/before_jan_2012/employeewise_balance_leave_report.py
index bab119e..83f2143 100644
--- a/erpnext/patches/before_jan_2012/employeewise_balance_leave_report.py
+++ b/erpnext/patches/before_jan_2012/employeewise_balance_leave_report.py
@@ -22,7 +22,7 @@
 """
 def execute():
 	from webnotes.model.doc import Document
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('hr', 'search_criteria', 'employeewise_balance_leave_report')
 	d = Document('Search Criteria', 'employeewise_balance_leave_report')
 	d.criteria_name = 'Employee Leave Balance Report'
diff --git a/erpnext/patches/before_jan_2012/erpnext_structure_cleanup.py b/erpnext/patches/before_jan_2012/erpnext_structure_cleanup.py
index aab64a0..a9dcd75 100644
--- a/erpnext/patches/before_jan_2012/erpnext_structure_cleanup.py
+++ b/erpnext/patches/before_jan_2012/erpnext_structure_cleanup.py
@@ -19,7 +19,7 @@
 
 import webnotes
 from webnotes.model import delete_doc
-from webnotes.modules.module_manager import reload_doc
+from webnotes.modules import reload_doc
 from webnotes.modules.export_module import export_to_files
 sql = webnotes.conn.sql
 
diff --git a/erpnext/patches/before_jan_2012/install_print_formats.py b/erpnext/patches/before_jan_2012/install_print_formats.py
index 3a18aae..ab0067c 100644
--- a/erpnext/patches/before_jan_2012/install_print_formats.py
+++ b/erpnext/patches/before_jan_2012/install_print_formats.py
@@ -68,7 +68,7 @@
 	"""
 		Install print formats
 	"""
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('core', 'doctype', 'print_format')
 	
 	#copy_doctype_to_pfs()
diff --git a/erpnext/patches/before_jan_2012/lcw_patch.py b/erpnext/patches/before_jan_2012/lcw_patch.py
index b274069..27e9a56 100644
--- a/erpnext/patches/before_jan_2012/lcw_patch.py
+++ b/erpnext/patches/before_jan_2012/lcw_patch.py
@@ -16,7 +16,7 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	
 	
 	reload_doc('stock', 'doctype', 'landed_cost_wizard')
diff --git a/erpnext/patches/before_jan_2012/packing_slip.py b/erpnext/patches/before_jan_2012/packing_slip.py
index 23c34d9d..7fe2d5d 100644
--- a/erpnext/patches/before_jan_2012/packing_slip.py
+++ b/erpnext/patches/before_jan_2012/packing_slip.py
@@ -16,7 +16,7 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('stock', 'doctype', 'delivery_note_detail')
 	reload_doc('stock', 'Print Format', 'Delivery Note Packing List Wise')
 	
diff --git a/erpnext/patches/before_jan_2012/price_list_patch.py b/erpnext/patches/before_jan_2012/price_list_patch.py
index ce2ff4a..6cd3f9b 100644
--- a/erpnext/patches/before_jan_2012/price_list_patch.py
+++ b/erpnext/patches/before_jan_2012/price_list_patch.py
@@ -16,7 +16,7 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 
 	reload_doc('accounts', 'doctype', 'receivable_voucher')
 	reload_doc('stock', 'doctype', 'delivery_note')
diff --git a/erpnext/patches/before_jan_2012/project_patch.py b/erpnext/patches/before_jan_2012/project_patch.py
index f4b0ea6..df0e1e9 100644
--- a/erpnext/patches/before_jan_2012/project_patch.py
+++ b/erpnext/patches/before_jan_2012/project_patch.py
@@ -16,7 +16,7 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	sql = webnotes.conn.sql
 	
 	# Reload item table
diff --git a/erpnext/patches/before_jan_2012/reload_address.py b/erpnext/patches/before_jan_2012/reload_address.py
index 3ef80d8..ae68f6f 100644
--- a/erpnext/patches/before_jan_2012/reload_address.py
+++ b/erpnext/patches/before_jan_2012/reload_address.py
@@ -16,6 +16,6 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 
 	reload_doc('utilities', 'doctype', 'address')
diff --git a/erpnext/patches/before_jan_2012/reload_bom.py b/erpnext/patches/before_jan_2012/reload_bom.py
index f925bc6..cbacce1 100644
--- a/erpnext/patches/before_jan_2012/reload_bom.py
+++ b/erpnext/patches/before_jan_2012/reload_bom.py
@@ -16,6 +16,6 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 
 	reload_doc('production', 'doctype', 'bill_of_materials')
diff --git a/erpnext/patches/before_jan_2012/reload_doclayer.py b/erpnext/patches/before_jan_2012/reload_doclayer.py
index 4ab077e..2c6e23e 100644
--- a/erpnext/patches/before_jan_2012/reload_doclayer.py
+++ b/erpnext/patches/before_jan_2012/reload_doclayer.py
@@ -18,7 +18,7 @@
 	Reload DocLayer, DocLayerField and Print Format doctypes
 """
 def execute():
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('core', 'doctype', 'print_format')
 	reload_doc('core', 'doctype', 'doclayer')
 	reload_doc('core', 'doctype', 'doclayerfield')
diff --git a/erpnext/patches/before_jan_2012/reload_email_digest.py b/erpnext/patches/before_jan_2012/reload_email_digest.py
index 13a2614..15cbfc3 100644
--- a/erpnext/patches/before_jan_2012/reload_email_digest.py
+++ b/erpnext/patches/before_jan_2012/reload_email_digest.py
@@ -15,5 +15,5 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 def execute():
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('Setup', 'DocType', 'Email Digest')
diff --git a/erpnext/patches/before_jan_2012/reload_employeewise_balance_leave_report.py b/erpnext/patches/before_jan_2012/reload_employeewise_balance_leave_report.py
index b60d3d4..53183cb 100644
--- a/erpnext/patches/before_jan_2012/reload_employeewise_balance_leave_report.py
+++ b/erpnext/patches/before_jan_2012/reload_employeewise_balance_leave_report.py
@@ -16,5 +16,5 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('hr', 'search_criteria', 'employeewise_balance_leave_report')
diff --git a/erpnext/patches/before_jan_2012/reload_flat_bom.py b/erpnext/patches/before_jan_2012/reload_flat_bom.py
index a46ad5e..020bd7e 100644
--- a/erpnext/patches/before_jan_2012/reload_flat_bom.py
+++ b/erpnext/patches/before_jan_2012/reload_flat_bom.py
@@ -16,7 +16,7 @@
 
 def execute():
 	from webnotes.modules import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 
 	reload_doc('production', 'doctype', 'flat_bom_detail')
 	reload_doc('production', 'doctype', 'bom_material')
diff --git a/erpnext/patches/before_jan_2012/reload_gl_mapper.py b/erpnext/patches/before_jan_2012/reload_gl_mapper.py
index 27f2c58..c43ab67 100644
--- a/erpnext/patches/before_jan_2012/reload_gl_mapper.py
+++ b/erpnext/patches/before_jan_2012/reload_gl_mapper.py
@@ -16,7 +16,7 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	
 	# reload jv gl mapper
 	reload_doc('accounts', 'GL Mapper', 'Journal Voucher')
diff --git a/erpnext/patches/before_jan_2012/reload_lc_wizard.py b/erpnext/patches/before_jan_2012/reload_lc_wizard.py
index 7645419..e3df031 100644
--- a/erpnext/patches/before_jan_2012/reload_lc_wizard.py
+++ b/erpnext/patches/before_jan_2012/reload_lc_wizard.py
@@ -16,7 +16,7 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	from webnotes.model import delete_doc
 
 	delete_doc('DocType', 'Landed Cost Wizard')
diff --git a/erpnext/patches/before_jan_2012/reload_print_format.py b/erpnext/patches/before_jan_2012/reload_print_format.py
index 37b83a6..9948beb 100644
--- a/erpnext/patches/before_jan_2012/reload_print_format.py
+++ b/erpnext/patches/before_jan_2012/reload_print_format.py
@@ -16,7 +16,7 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	from webnotes.model.doc import addchild
 	from webnotes.model.code import get_obj
 	reload_doc('stock', 'Print Format', 'Delivery Note Packing List Wise')
diff --git a/erpnext/patches/before_jan_2012/reload_project_task.py b/erpnext/patches/before_jan_2012/reload_project_task.py
index 14d39fd..f174603 100644
--- a/erpnext/patches/before_jan_2012/reload_project_task.py
+++ b/erpnext/patches/before_jan_2012/reload_project_task.py
@@ -18,6 +18,6 @@
 	Reload Task Doctype of Project Module
 """
 def execute():
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('Projects', 'DocType', 'Ticket')
 
diff --git a/erpnext/patches/before_jan_2012/reload_reco.py b/erpnext/patches/before_jan_2012/reload_reco.py
index 9335992..782fc7f 100644
--- a/erpnext/patches/before_jan_2012/reload_reco.py
+++ b/erpnext/patches/before_jan_2012/reload_reco.py
@@ -16,7 +16,7 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	
 	reload_doc('stock', 'doctype', 'stock_reconciliation')
 	webnotes.conn.sql("delete from `tabDocField` where (label in ('Validate Data', 'Attachment HTML', 'Attachment') or fieldname in ('next_step', 'company', 'fiscal_year', 'amendment_date')) and parent = 'Stock Reconciliation'")
diff --git a/erpnext/patches/before_jan_2012/reload_rv.py b/erpnext/patches/before_jan_2012/reload_rv.py
index f41db49..4365563 100644
--- a/erpnext/patches/before_jan_2012/reload_rv.py
+++ b/erpnext/patches/before_jan_2012/reload_rv.py
@@ -16,7 +16,7 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	from webnotes.model.code import get_obj
 
 	reload_doc('accounts', 'doctype', 'receivable_voucher')
diff --git a/erpnext/patches/before_jan_2012/reload_support_ticket.py b/erpnext/patches/before_jan_2012/reload_support_ticket.py
index 803754f..f889687 100644
--- a/erpnext/patches/before_jan_2012/reload_support_ticket.py
+++ b/erpnext/patches/before_jan_2012/reload_support_ticket.py
@@ -16,7 +16,7 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('Support', 'DocType', 'Support Ticket')
 	from webnotes.model.code import get_obj
 	get_obj('DocType', 'Support Ticket').validate()
diff --git a/erpnext/patches/before_jan_2012/sal_man_patch.py b/erpnext/patches/before_jan_2012/sal_man_patch.py
index b8f5301..626d2e3 100644
--- a/erpnext/patches/before_jan_2012/sal_man_patch.py
+++ b/erpnext/patches/before_jan_2012/sal_man_patch.py
@@ -17,7 +17,7 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	sql = webnotes.conn.sql
 
 	reload_doc('hr', 'doctype', 'salary_manager')
diff --git a/erpnext/patches/before_jan_2012/task_email_notification.py b/erpnext/patches/before_jan_2012/task_email_notification.py
index 8d1a078..9f7669a 100644
--- a/erpnext/patches/before_jan_2012/task_email_notification.py
+++ b/erpnext/patches/before_jan_2012/task_email_notification.py
@@ -16,5 +16,5 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('projects', 'doctype', 'ticket')
diff --git a/erpnext/patches/jan_mar_2012/allocated_to_profile.py b/erpnext/patches/jan_mar_2012/allocated_to_profile.py
index 32c7a2c..ef0ee97 100644
--- a/erpnext/patches/jan_mar_2012/allocated_to_profile.py
+++ b/erpnext/patches/jan_mar_2012/allocated_to_profile.py
@@ -32,5 +32,5 @@
 		AND label='Make Maintenance Visit'
 	""")
 
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('support', 'doctype', 'customer_issue')
diff --git a/erpnext/patches/jan_mar_2012/apps/todo_item.py b/erpnext/patches/jan_mar_2012/apps/todo_item.py
index 6eec6fd..bbef232 100644
--- a/erpnext/patches/jan_mar_2012/apps/todo_item.py
+++ b/erpnext/patches/jan_mar_2012/apps/todo_item.py
@@ -18,5 +18,5 @@
 	"""
 		* Reload ToDo Item
 	"""
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('utilities', 'doctype', 'todo_item')
diff --git a/erpnext/patches/jan_mar_2012/customer_address_contact_patch.py b/erpnext/patches/jan_mar_2012/customer_address_contact_patch.py
index 4671143..32a2125 100644
--- a/erpnext/patches/jan_mar_2012/customer_address_contact_patch.py
+++ b/erpnext/patches/jan_mar_2012/customer_address_contact_patch.py
@@ -26,7 +26,7 @@
 	patch_primary_address()
 
 def reload_sc():
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('selling', 'search_criteria', 'customer_address_contact')
 	reload_doc('selling', 'Module Def', 'Selling')
 
diff --git a/erpnext/patches/jan_mar_2012/deploy_packing_slip.py b/erpnext/patches/jan_mar_2012/deploy_packing_slip.py
index 7a28ef8..653ff58 100644
--- a/erpnext/patches/jan_mar_2012/deploy_packing_slip.py
+++ b/erpnext/patches/jan_mar_2012/deploy_packing_slip.py
@@ -15,7 +15,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 import webnotes
-from webnotes.modules.module_manager import reload_doc
+from webnotes.modules import reload_doc
 
 def execute():
 	delete_fields_dn_detail()
diff --git a/erpnext/patches/jan_mar_2012/doclabel_in_doclayer.py b/erpnext/patches/jan_mar_2012/doclabel_in_doclayer.py
index a6f7a7c..0b6f405 100644
--- a/erpnext/patches/jan_mar_2012/doclabel_in_doclayer.py
+++ b/erpnext/patches/jan_mar_2012/doclabel_in_doclayer.py
@@ -24,5 +24,5 @@
 		UPDATE `tabDocField` SET options=NULL
 		WHERE parent='DocLayer' AND fieldname='doc_type'
 	""")
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('core', 'doctype', 'doclayer')
diff --git a/erpnext/patches/jan_mar_2012/dt_map_fix.py b/erpnext/patches/jan_mar_2012/dt_map_fix.py
index f669009..37732df 100644
--- a/erpnext/patches/jan_mar_2012/dt_map_fix.py
+++ b/erpnext/patches/jan_mar_2012/dt_map_fix.py
@@ -1,6 +1,6 @@
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	webnotes.conn.sql("delete from `tabField Mapper Detail` where from_field = 'transaction_date' and parent in ('Sales Order-Delivery Note', 'Purchase Order-Purchase Receipt')")
 
 	reload_doc('stock', 'DocType Mapper', 'Sales Order-Delivery Note')
diff --git a/erpnext/patches/jan_mar_2012/email_settings_reload.py b/erpnext/patches/jan_mar_2012/email_settings_reload.py
index ec6f05d..85c683e 100644
--- a/erpnext/patches/jan_mar_2012/email_settings_reload.py
+++ b/erpnext/patches/jan_mar_2012/email_settings_reload.py
@@ -25,5 +25,5 @@
 		WHERE parent = 'Email Settings' AND fieldname = 'mail_port'
 	""")
 
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('setup', 'doctype', 'email_settings')
diff --git a/erpnext/patches/jan_mar_2012/jan_production_patches.py b/erpnext/patches/jan_mar_2012/jan_production_patches.py
index d57fb9e..479cecb 100644
--- a/erpnext/patches/jan_mar_2012/jan_production_patches.py
+++ b/erpnext/patches/jan_mar_2012/jan_production_patches.py
@@ -20,7 +20,7 @@
 		Patch includes:
 		* Reload of Stock Entry Detail
 	"""
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 
 	reload_doc('stock', 'doctype', 'stock_entry_detail')
 	reload_doc('stock', 'doctype', 'item_supplier')
diff --git a/erpnext/patches/jan_mar_2012/label_cleanup.py b/erpnext/patches/jan_mar_2012/label_cleanup.py
index b40f36f..f158495 100644
--- a/erpnext/patches/jan_mar_2012/label_cleanup.py
+++ b/erpnext/patches/jan_mar_2012/label_cleanup.py
@@ -1,7 +1,7 @@
 def execute():
 	import webnotes
 	from webnotes.model import delete_doc
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 
 	dt = {
 		'selling':	['quotation', 'sales_order', 'quotation_detail', 'sales_order_detail'], 
diff --git a/erpnext/patches/jan_mar_2012/pending_patches.py b/erpnext/patches/jan_mar_2012/pending_patches.py
index 351200f..821a411 100644
--- a/erpnext/patches/jan_mar_2012/pending_patches.py
+++ b/erpnext/patches/jan_mar_2012/pending_patches.py
@@ -17,7 +17,7 @@
 def execute():
 	import webnotes
 	from webnotes.model.code import get_obj
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	sql = webnotes.conn.sql
 
 	reload_doc('hr', 'doctype', 'appraisal')
diff --git a/erpnext/patches/jan_mar_2012/production_cleanup.py b/erpnext/patches/jan_mar_2012/production_cleanup.py
index d0a5879..e715f27 100644
--- a/erpnext/patches/jan_mar_2012/production_cleanup.py
+++ b/erpnext/patches/jan_mar_2012/production_cleanup.py
@@ -16,7 +16,7 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	from webnotes.model import delete_doc
 	sql = webnotes.conn.sql
 	
diff --git a/erpnext/patches/jan_mar_2012/reload_doctype.py b/erpnext/patches/jan_mar_2012/reload_doctype.py
index 51241b8..957864b 100644
--- a/erpnext/patches/jan_mar_2012/reload_doctype.py
+++ b/erpnext/patches/jan_mar_2012/reload_doctype.py
@@ -16,5 +16,5 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('core', 'doctype', 'doctype')
diff --git a/erpnext/patches/jan_mar_2012/reload_item.py b/erpnext/patches/jan_mar_2012/reload_item.py
index c45b818..e42b50b 100644
--- a/erpnext/patches/jan_mar_2012/reload_item.py
+++ b/erpnext/patches/jan_mar_2012/reload_item.py
@@ -16,7 +16,7 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('stock', 'doctype', 'item')
 
 	webnotes.conn.sql("update `tabItem` set re_order_qty = min_order_qty")
diff --git a/erpnext/patches/jan_mar_2012/reload_po_pr_mapper.py b/erpnext/patches/jan_mar_2012/reload_po_pr_mapper.py
index 4ed252b..5866429 100644
--- a/erpnext/patches/jan_mar_2012/reload_po_pr_mapper.py
+++ b/erpnext/patches/jan_mar_2012/reload_po_pr_mapper.py
@@ -16,5 +16,5 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('stock', 'DocType Mapper', 'Purchase Order-Purchase Receipt')
diff --git a/erpnext/patches/jan_mar_2012/reload_table.py b/erpnext/patches/jan_mar_2012/reload_table.py
index 481b46f..28a597b 100644
--- a/erpnext/patches/jan_mar_2012/reload_table.py
+++ b/erpnext/patches/jan_mar_2012/reload_table.py
@@ -1,6 +1,6 @@
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('selling', 'doctype', 'quotation_detail')
 	reload_doc('selling', 'doctype', 'sales_order_detail')
 	reload_doc('stock', 'doctype', 'delivery_note_detail')
diff --git a/erpnext/patches/jan_mar_2012/remove_get_tds_button.py b/erpnext/patches/jan_mar_2012/remove_get_tds_button.py
index fe804c0..8549e0d 100644
--- a/erpnext/patches/jan_mar_2012/remove_get_tds_button.py
+++ b/erpnext/patches/jan_mar_2012/remove_get_tds_button.py
@@ -26,5 +26,5 @@
 		AND fieldtype='Button'
 	""")
 
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('accounts', 'doctype', 'journal_voucher')
diff --git a/erpnext/patches/jan_mar_2012/rename_doctype_indent.py b/erpnext/patches/jan_mar_2012/rename_doctype_indent.py
index 01aeebf..4e026f7 100644
--- a/erpnext/patches/jan_mar_2012/rename_doctype_indent.py
+++ b/erpnext/patches/jan_mar_2012/rename_doctype_indent.py
@@ -47,7 +47,7 @@
 		* purchase_order
 		* po_detail
 	"""
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('buying', 'doctype', 'indent')
 	reload_doc('buying', 'doctype', 'purchase_order')
 	reload_doc('buying', 'doctype', 'po_detail')
diff --git a/erpnext/patches/jan_mar_2012/serial_no_add_opt.py b/erpnext/patches/jan_mar_2012/serial_no_add_opt.py
index 947c28d..ec45c27 100644
--- a/erpnext/patches/jan_mar_2012/serial_no_add_opt.py
+++ b/erpnext/patches/jan_mar_2012/serial_no_add_opt.py
@@ -30,5 +30,5 @@
 			webnotes.conn.commit()
 			webnotes.conn.begin()
 
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('stock', 'doctype', 'serial_no')
diff --git a/erpnext/patches/jan_mar_2012/stable_branch_shift_09_01_12.py b/erpnext/patches/jan_mar_2012/stable_branch_shift_09_01_12.py
index e4078aa..d155107 100644
--- a/erpnext/patches/jan_mar_2012/stable_branch_shift_09_01_12.py
+++ b/erpnext/patches/jan_mar_2012/stable_branch_shift_09_01_12.py
@@ -15,7 +15,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 import webnotes
-from webnotes.modules.module_manager import reload_doc
+from webnotes.modules import reload_doc
 	
 def execute():
 	"""
diff --git a/erpnext/patches/jan_mar_2012/website/domain_list.py b/erpnext/patches/jan_mar_2012/website/domain_list.py
index 25f50e2..26824a4 100644
--- a/erpnext/patches/jan_mar_2012/website/domain_list.py
+++ b/erpnext/patches/jan_mar_2012/website/domain_list.py
@@ -16,7 +16,7 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('website', 'doctype', 'website_settings')
 
 	res = webnotes.conn.sql("""\
diff --git a/erpnext/patches/old_patches/customer_address.py b/erpnext/patches/old_patches/customer_address.py
index 44568ce..4757c02 100644
--- a/erpnext/patches/old_patches/customer_address.py
+++ b/erpnext/patches/old_patches/customer_address.py
@@ -21,7 +21,7 @@
 from webnotes import msgprint, errprint
 
 def make_address():
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('utilities','doctype','address')
 	
 	from webnotes.model.db_schema import updatedb
@@ -128,7 +128,7 @@
 #		export_to_files(record_list=[['DocType',dt]])
 
 def reload_doc_files():
-	from webnotes.modules.module_manager import reload_doc	
+	from webnotes.modules import reload_doc	
 	reload_doc('utilities', 'doctype', 'contact')
 	reload_doc('selling', 'doctype', 'customer')
 	reload_doc('support', 'doctype', 'customer_issue')
@@ -149,7 +149,7 @@
 	reload_doc('buying', 'doctype', 'supplier')
 	
 def reload_mapper_files():
-	from webnotes.modules.module_manager import reload_doc	
+	from webnotes.modules import reload_doc	
 	reload_doc('Mapper', 'DocType Mapper', 'Customer Issue-Maintenance Visit')
 	reload_doc('Mapper', 'DocType Mapper', 'Delivery Note-Installation Note')
 	reload_doc('Mapper', 'DocType Mapper', 'Delivery Note-Receivable Voucher')
diff --git a/erpnext/patches/old_patches/doctype_permission_patch.py b/erpnext/patches/old_patches/doctype_permission_patch.py
index 0953864..b23277a 100644
--- a/erpnext/patches/old_patches/doctype_permission_patch.py
+++ b/erpnext/patches/old_patches/doctype_permission_patch.py
@@ -21,7 +21,7 @@
 	# remove descriptions
 	webnotes.conn.sql("update tabDocType set description=null")
 		
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('core','doctype','custom_script')
 	reload_doc('core','doctype','custom_field')
 	reload_doc('core','doctype','property_setter')
diff --git a/erpnext/patches/old_patches/feed_patch.py b/erpnext/patches/old_patches/feed_patch.py
index 1edac88..d1fa147 100644
--- a/erpnext/patches/old_patches/feed_patch.py
+++ b/erpnext/patches/old_patches/feed_patch.py
@@ -110,7 +110,7 @@
 def support_patch():
 	# relaod support and other doctypes
 	
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	
 	webnotes.model.delete_doc('DocType','Support Ticket')
 	reload_doc('setup','doctype','support_email_settings')
diff --git a/erpnext/patches/old_patches/patch_1.py b/erpnext/patches/old_patches/patch_1.py
index 4176bf5..9e9cb6f 100644
--- a/erpnext/patches/old_patches/patch_1.py
+++ b/erpnext/patches/old_patches/patch_1.py
@@ -781,12 +781,12 @@
 	except: pass
 
 	# import
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('event_updates','doctype','feed')
 elif patch_no==185:
 	sql("delete from tabDocTrigger where method = 'webnotes.widgets.follow.on_docsave'")
 elif patch_no==186:
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('event_updates','doctype','feed')
 elif patch_no == 187:
 	sql("update tabDocType set autoname = '' where name = 'QA Inspection Report'")
@@ -807,7 +807,7 @@
 	sql("delete from `tabModule Def Item` where parent = 'SRM' and doc_name = 'Landed Cost Wizard' and display_name = 'Landed Cost Wizard'")
 	import_from_files(record_list = [['stock', 'Module Def', 'Material Management']])
 elif patch_no == 195:
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('setup','doctype','manage_account')
 elif patch_no == 196:
 	sql("update `tabModule Def` set module_page = null where name = 'Material Management'")
diff --git a/erpnext/patches/patch.py b/erpnext/patches/patch.py
index 744b102..5b9f7a0 100644
--- a/erpnext/patches/patch.py
+++ b/erpnext/patches/patch.py
@@ -24,7 +24,7 @@
 def execute(patch_no):
 	return
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 
 	from webnotes.model.code import get_obj
 	sql = webnotes.conn.sql
@@ -377,7 +377,7 @@
 	elif patch_no == 370:
 		sql("update `tabDocField` set `hidden` = 0 where fieldname = 'group_or_ledger' and parent = 'Cost Center'")
 	elif patch_no == 371:
-		from webnotes.modules.module_manager import reload_doc
+		from webnotes.modules import reload_doc
 
 		reload_doc('setup', 'doctype','features_setup')
 		flds = ['page_break', 'projects', 'packing_details', 'discounts', 'brands', 'item_batch_nos', 'after_sales_installations', 'item_searial_nos', 'item_group_in_details', 'exports', 'imports', 'item_advanced', 'sales_extras', 'more_info', 'quality', 'manufacturing', 'pos', 'item_serial_nos']
@@ -393,7 +393,7 @@
 
 		get_obj('Features Setup', 'Features Setup').doc.save()
 	elif patch_no == 372:
-		from webnotes.modules.module_manager import reload_doc
+		from webnotes.modules import reload_doc
 
 		reload_doc('setup', 'doctype','features_setup')
 		flds = ['page_break', 'projects', 'packing_details', 'discounts', 'brands', 'item_batch_nos', 'after_sales_installations', 'item_searial_nos', 'item_group_in_details', 'exports', 'imports', 'item_advanced', 'sales_extras', 'more_info', 'quality', 'manufacturing', 'pos', 'item_serial_nos']
diff --git a/erpnext/production/doctype/bill_of_materials/bill_of_materials.py b/erpnext/production/doctype/bill_of_materials/bill_of_materials.py
index 3f0bb9e..dfbc998 100644
--- a/erpnext/production/doctype/bill_of_materials/bill_of_materials.py
+++ b/erpnext/production/doctype/bill_of_materials/bill_of_materials.py
@@ -91,14 +91,12 @@
 
 		arg = eval(arg)
 		item = self.get_item_det(arg['item_code'])
-
 		self.validate_rm_item(item)
 		
 		arg['bom_no'] = arg['bom_no'] or item and cstr(item[0]['default_bom']) or ''
 		arg.update(item[0])
 
 		rate = self.get_rm_rate(arg)
-
 		ret_item = {
 					 'description'  : item and arg['description'] or '',
 					 'stock_uom'	: item and arg['stock_uom'] or '',
@@ -209,11 +207,11 @@
 		"""Fetch RM rate as per today's valuation rate and calculate totals"""
 		total_rm_cost = 0
 		for d in getlist(self.doclist, 'bom_materials'):
-			if self.doc.rm_cost_as_per == 'Valuation Rate':
-				arg = {'item_code': d.item_code, 'qty': d.qty, 'bom_no': d.bom_no}
-				ret = self.get_bom_material_detail(cstr(arg))
-				for k in ret:
-					d.fields[k] = ret[k]
+			#if self.doc.rm_cost_as_per == 'Valuation Rate':
+			arg = {'item_code': d.item_code, 'qty': d.qty, 'bom_no': d.bom_no}
+			ret = self.get_bom_material_detail(cstr(arg))
+			for k in ret:
+				d.fields[k] = ret[k]
 
 			d.amount = flt(d.rate) * flt(d.qty)
 			total_rm_cost += d.amount
diff --git a/erpnext/projects/Module Def/Projects/Projects.txt b/erpnext/projects/Module Def/Projects/Projects.txt
deleted file mode 100644
index f8cf6f7..0000000
--- a/erpnext/projects/Module Def/Projects/Projects.txt
+++ /dev/null
@@ -1,141 +0,0 @@
-[
-	{
-		'_last_update': '1300959287',
-		'creation': '2010-11-30 17:31:44',
-		'disabled': 'No',
-		'docstatus': 0,
-		'doctype': u'Module Def',
-		'doctype_list': None,
-		'file_list': 'undefined,undefined',
-		'idx': None,
-		'is_hidden': 'No',
-		'last_updated_date': '2011-03-10 15:57:47',
-		'modified': '2011-03-24 15:07:53',
-		'modified_by': 'Administrator',
-		'module_desc': '<div id="projects_div"></div>',
-		'module_icon': 'puzzle.png',
-		'module_label': 'Projects',
-		'module_name': 'Projects',
-		'module_page': None,
-		'module_seq': 2,
-		'name': 'Projects',
-		'owner': 'Administrator',
-		'parent': None,
-		'parentfield': None,
-		'parenttype': None,
-		'trash_reason': None,
-		'widget_code': None
-	},
-	{
-		'click_function': None,
-		'creation': '2010-11-30 17:31:44',
-		'description': None,
-		'display_name': 'Project',
-		'doc_name': 'Project',
-		'doc_type': 'Forms',
-		'docstatus': 0,
-		'doctype': 'Module Def Item',
-		'fields': None,
-		'hide': None,
-		'icon': None,
-		'idx': 1,
-		'modified': '2011-03-24 15:07:53',
-		'modified_by': 'Administrator',
-		'name': 'MDI00099',
-		'owner': 'Administrator',
-		'parent': 'Projects',
-		'parentfield': 'items',
-		'parenttype': 'Module Def'
-	},
-	{
-		'click_function': None,
-		'creation': None,
-		'description': None,
-		'display_name': 'Task',
-		'doc_name': 'Ticket',
-		'doc_type': 'Forms',
-		'docstatus': 0,
-		'doctype': 'Module Def Item',
-		'fields': None,
-		'hide': None,
-		'icon': None,
-		'idx': 2,
-		'modified': '2011-03-24 15:07:53',
-		'modified_by': 'Administrator',
-		'name': 'MDI00285',
-		'owner': None,
-		'parent': 'Projects',
-		'parentfield': 'items',
-		'parenttype': 'Module Def'
-	},
-	{
-		'click_function': None,
-		'creation': None,
-		'description': None,
-		'display_name': 'Gantt Chart',
-		'doc_name': 'Projects',
-		'doc_type': 'Pages',
-		'docstatus': 0,
-		'doctype': 'Module Def Item',
-		'fields': None,
-		'hide': None,
-		'icon': None,
-		'idx': 3,
-		'modified': '2011-03-24 15:07:53',
-		'modified_by': 'Administrator',
-		'name': 'MDI00286',
-		'owner': None,
-		'parent': 'Projects',
-		'parentfield': 'items',
-		'parenttype': 'Module Def'
-	},
-	{
-		'click_function': None,
-		'creation': None,
-		'description': None,
-		'display_name': 'Timesheet',
-		'doc_name': 'Timesheet',
-		'doc_type': 'Forms',
-		'docstatus': 0,
-		'doctype': 'Module Def Item',
-		'fields': None,
-		'hide': None,
-		'icon': None,
-		'idx': 4,
-		'modified': '2011-03-24 15:07:53',
-		'modified_by': 'Administrator',
-		'name': 'MDI00287',
-		'owner': None,
-		'parent': 'Projects',
-		'parentfield': 'items',
-		'parenttype': 'Module Def'
-	},
-	{
-		'creation': '2010-11-30 17:31:44',
-		'docstatus': 0,
-		'doctype': 'Module Def Role',
-		'idx': 1,
-		'modified': '2011-03-24 15:07:53',
-		'modified_by': 'Administrator',
-		'name': 'MDR00012',
-		'owner': 'Administrator',
-		'parent': 'Projects',
-		'parentfield': 'roles',
-		'parenttype': 'Module Def',
-		'role': 'Projects User'
-	},
-	{
-		'creation': '2010-11-30 17:31:44',
-		'docstatus': 0,
-		'doctype': 'Module Def Role',
-		'idx': 2,
-		'modified': '2011-03-24 15:07:53',
-		'modified_by': 'Administrator',
-		'name': 'MDR00013',
-		'owner': 'Administrator',
-		'parent': 'Projects',
-		'parentfield': 'roles',
-		'parenttype': 'Module Def',
-		'role': 'System Manager'
-	}
-]
\ No newline at end of file
diff --git a/erpnext/projects/doctype/project/project.txt b/erpnext/projects/doctype/project/project.txt
index 3d57e12..936fd7d 100644
--- a/erpnext/projects/doctype/project/project.txt
+++ b/erpnext/projects/doctype/project/project.txt
@@ -5,47 +5,51 @@
 	{
 		'creation': '2010-08-08 17:09:14',
 		'docstatus': 0,
-		'modified': '2011-01-05 15:24:43',
-		'modified_by': 'Administrator',
-		'owner': 'Administrator'
+		'modified': '2012-03-12 16:07:48',
+		'modified_by': u'Administrator',
+		'owner': u'Administrator'
 	},
 
 	# These values are common for all DocType
 	{
-		'_last_update': '1305714062',
+		'_last_update': u'1331542508',
+		'allow_attach': 1,
 		'allow_trash': 1,
-		'autoname': 'field:project_name',
-		'colour': 'White:FFF',
+		'autoname': u'field:project_name',
+		'colour': u'White:FFF',
+		'default_print_format': u'Standard',
 		'doctype': 'DocType',
-		'document_type': 'Master',
-		'module': 'Projects',
+		'document_type': u'Master',
+		'max_attachments': 4,
+		'module': u'Projects',
 		'name': '__common__',
-		'search_fields': 'customer, status, priority, is_active',
-		'section_style': 'Tabbed',
-		'server_code_error': ' ',
-		'subject': ' ',
-		'tag_fields': 'status',
-		'version': 32
+		'search_fields': u'customer, status, priority, is_active',
+		'section_style': u'Tabbed',
+		'server_code_error': u' ',
+		'show_in_menu': 0,
+		'subject': u' ',
+		'tag_fields': u'status',
+		'version': 38
 	},
 
 	# These values are common for all DocField
 	{
-		'doctype': 'DocField',
+		'doctype': u'DocField',
 		'name': '__common__',
-		'parent': 'Project',
-		'parentfield': 'fields',
-		'parenttype': 'DocType'
+		'parent': u'Project',
+		'parentfield': u'fields',
+		'parenttype': u'DocType'
 	},
 
 	# These values are common for all DocPerm
 	{
 		'cancel': 1,
 		'create': 1,
-		'doctype': 'DocPerm',
+		'doctype': u'DocPerm',
 		'name': '__common__',
-		'parent': 'Project',
-		'parentfield': 'permissions',
-		'parenttype': 'DocType',
+		'parent': u'Project',
+		'parentfield': u'permissions',
+		'parenttype': u'DocType',
 		'permlevel': 0,
 		'read': 1,
 		'write': 1
@@ -54,45 +58,58 @@
 	# DocType, Project
 	{
 		'doctype': 'DocType',
-		'name': 'Project'
+		'name': u'Project'
 	},
 
 	# DocPerm
 	{
-		'doctype': 'DocPerm',
-		'idx': 1,
-		'role': 'All'
+		'doctype': u'DocPerm',
+		'role': u'All'
 	},
 
 	# DocPerm
 	{
-		'doctype': 'DocPerm',
-		'idx': 2,
-		'role': 'Projects User'
+		'doctype': u'DocPerm',
+		'role': u'Projects User'
 	},
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'description': 'Helps you keep track of your projects and links to Tasks. You can tag a task to a project to track its progress',
-		'doctype': 'DocField',
-		'fieldtype': 'Section Break',
-		'idx': 1,
-		'label': 'Basic Info',
-		'oldfieldtype': 'Section Break',
+		'colour': u'White:FFF',
+		'description': u'Helps you keep track of your projects and links to Tasks. You can tag a task to a project to track its progress',
+		'doctype': u'DocField',
+		'fieldtype': u'Section Break',
+		'label': u'Basic Info',
+		'oldfieldtype': u'Section Break',
 		'permlevel': 0
 	},
 
 	# DocField
 	{
-		'description': 'Project will get saved and will be searchable with project name given',
-		'doctype': 'DocField',
-		'fieldname': 'project_name',
-		'fieldtype': 'Data',
-		'idx': 2,
-		'label': 'Project Name',
-		'oldfieldname': 'project_name',
-		'oldfieldtype': 'Data',
+		'description': u'Project will get saved and will be searchable with project name given',
+		'doctype': u'DocField',
+		'fieldname': u'project_name',
+		'fieldtype': u'Data',
+		'label': u'Project Name',
+		'oldfieldname': u'project_name',
+		'oldfieldtype': u'Data',
+		'permlevel': 0,
+		'reqd': 1
+	},
+
+	# DocField
+	{
+		'colour': u'White:FFF',
+		'default': u'Open',
+		'doctype': u'DocField',
+		'fieldname': u'status',
+		'fieldtype': u'Select',
+		'in_filter': 1,
+		'label': u'Status',
+		'no_copy': 1,
+		'oldfieldname': u'status',
+		'oldfieldtype': u'Select',
+		'options': u'Open\nCompleted\nCancelled',
 		'permlevel': 0,
 		'reqd': 1,
 		'search_index': 1
@@ -100,385 +117,357 @@
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'default': 'Open',
-		'doctype': 'DocField',
-		'fieldname': 'status',
-		'fieldtype': 'Select',
-		'idx': 3,
+		'doctype': u'DocField',
+		'fieldname': u'is_active',
+		'fieldtype': u'Select',
+		'label': u'Is Active',
+		'oldfieldname': u'is_active',
+		'oldfieldtype': u'Select',
+		'options': u'Yes\nNo',
+		'permlevel': 0
+	},
+
+	# DocField
+	{
+		'doctype': u'DocField',
+		'fieldname': u'priority',
+		'fieldtype': u'Select',
+		'label': u'Priority',
+		'oldfieldname': u'priority',
+		'oldfieldtype': u'Select',
+		'options': u'Medium\nLow\nHigh',
+		'permlevel': 0
+	},
+
+	# DocField
+	{
+		'doctype': u'DocField',
+		'fieldtype': u'Column Break',
+		'permlevel': 0
+	},
+
+	# DocField
+	{
+		'doctype': u'DocField',
+		'fieldname': u'project_type',
+		'fieldtype': u'Data',
+		'label': u'Project Type',
+		'oldfieldname': u'project_type',
+		'oldfieldtype': u'Data',
+		'permlevel': 0
+	},
+
+	# DocField
+	{
+		'doctype': u'DocField',
+		'fieldname': u'project_start_date',
+		'fieldtype': u'Date',
 		'in_filter': 1,
-		'label': 'Status',
-		'oldfieldname': 'status',
-		'oldfieldtype': 'Select',
-		'options': 'Open\nCompleted\nCancelled',
-		'permlevel': 0,
-		'reqd': 1,
-		'search_index': 0
-	},
-
-	# DocField
-	{
-		'doctype': 'DocField',
-		'fieldname': 'is_active',
-		'fieldtype': 'Select',
-		'idx': 4,
-		'label': 'Is Active',
-		'oldfieldname': 'is_active',
-		'oldfieldtype': 'Select',
-		'options': 'Yes\nNo',
+		'label': u'Project Start Date',
+		'oldfieldname': u'project_start_date',
+		'oldfieldtype': u'Date',
 		'permlevel': 0
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'priority',
-		'fieldtype': 'Select',
-		'idx': 5,
-		'label': 'Priority',
-		'oldfieldname': 'priority',
-		'oldfieldtype': 'Select',
-		'options': 'Medium\nLow\nHigh',
+		'doctype': u'DocField',
+		'fieldname': u'completion_date',
+		'fieldtype': u'Date',
+		'label': u'Completion Date',
+		'oldfieldname': u'completion_date',
+		'oldfieldtype': u'Date',
 		'permlevel': 0
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'project_value',
-		'fieldtype': 'Currency',
-		'idx': 6,
-		'label': 'Project Value',
-		'oldfieldname': 'project_value',
-		'oldfieldtype': 'Currency',
-		'permlevel': 0,
-		'reqd': 1,
-		'trigger': 'Client'
-	},
-
-	# DocField
-	{
-		'doctype': 'DocField',
-		'fieldname': 'gross_margin_value',
-		'fieldtype': 'Currency',
-		'idx': 7,
-		'label': 'Gross Margin Value',
-		'oldfieldname': 'gross_margin_value',
-		'oldfieldtype': 'Currency',
-		'permlevel': 0,
-		'reqd': 1
-	},
-
-	# DocField
-	{
-		'doctype': 'DocField',
-		'fieldname': 'per_gross_margin',
-		'fieldtype': 'Currency',
-		'idx': 8,
-		'label': 'Gross Margin %',
-		'oldfieldname': 'per_gross_margin',
-		'oldfieldtype': 'Currency',
-		'permlevel': 0,
-		'reqd': 1
-	},
-
-	# DocField
-	{
-		'doctype': 'DocField',
-		'fieldname': 'est_material_cost',
-		'fieldtype': 'Currency',
-		'idx': 9,
-		'label': 'Estimated Material Cost',
-		'oldfieldname': 'est_material_cost',
-		'oldfieldtype': 'Currency',
-		'permlevel': 0,
-		'trigger': 'Client'
-	},
-
-	# DocField
-	{
-		'doctype': 'DocField',
-		'fieldname': 'project_type',
-		'fieldtype': 'Data',
-		'idx': 10,
-		'label': 'Project Type',
-		'oldfieldname': 'project_type',
-		'oldfieldtype': 'Data',
+		'doctype': u'DocField',
+		'fieldname': u'act_completion_date',
+		'fieldtype': u'Date',
+		'label': u'Actual Completion Date',
+		'oldfieldname': u'act_completion_date',
+		'oldfieldtype': u'Date',
 		'permlevel': 0
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'project_start_date',
-		'fieldtype': 'Date',
-		'idx': 11,
-		'in_filter': 1,
-		'label': 'Project Start Date',
-		'oldfieldname': 'project_start_date',
-		'oldfieldtype': 'Date',
-		'permlevel': 0
-	},
-
-	# DocField
-	{
-		'doctype': 'DocField',
-		'fieldname': 'completion_date',
-		'fieldtype': 'Date',
-		'idx': 12,
-		'label': 'Completion Date',
-		'oldfieldname': 'completion_date',
-		'oldfieldtype': 'Date',
-		'permlevel': 0
-	},
-
-	# DocField
-	{
-		'doctype': 'DocField',
-		'fieldname': 'act_completion_date',
-		'fieldtype': 'Date',
-		'idx': 13,
-		'label': 'Actual Completion Date',
-		'oldfieldname': 'act_completion_date',
-		'oldfieldtype': 'Date',
-		'permlevel': 0
-	},
-
-	# DocField
-	{
-		'doctype': 'DocField',
-		'fieldname': 'amended_from',
-		'fieldtype': 'Data',
+		'doctype': u'DocField',
+		'fieldname': u'amemdment_date',
+		'fieldtype': u'Date',
 		'hidden': 1,
-		'idx': 14,
-		'label': 'Amended From',
+		'label': u'Amemdment Date',
 		'no_copy': 1,
-		'oldfieldname': 'amended_from',
-		'oldfieldtype': 'Data',
+		'oldfieldname': u'amemdment_date',
+		'oldfieldtype': u'Date',
+		'permlevel': 1
+	},
+
+	# DocField
+	{
+		'doctype': u'DocField',
+		'fieldname': u'amended_from',
+		'fieldtype': u'Data',
+		'hidden': 1,
+		'label': u'Amended From',
+		'no_copy': 1,
+		'oldfieldname': u'amended_from',
+		'oldfieldtype': u'Data',
 		'permlevel': 1,
 		'print_hide': 0
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'amemdment_date',
-		'fieldtype': 'Date',
-		'hidden': 1,
-		'idx': 15,
-		'label': 'Amemdment Date',
-		'no_copy': 1,
-		'oldfieldname': 'amemdment_date',
-		'oldfieldtype': 'Date',
-		'permlevel': 1
-	},
-
-	# DocField
-	{
-		'doctype': 'DocField',
-		'fieldtype': 'Section Break',
-		'idx': 16,
-		'label': 'Project Details',
-		'oldfieldtype': 'Section Break',
-		'options': 'Simple',
+		'doctype': u'DocField',
+		'fieldtype': u'Section Break',
+		'label': u'Details',
+		'oldfieldtype': u'Section Break',
 		'permlevel': 0
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldtype': 'Column Break',
-		'idx': 17,
-		'oldfieldtype': 'Column Break',
+		'doctype': u'DocField',
+		'fieldname': u'notes',
+		'fieldtype': u'Text Editor',
+		'label': u'Notes',
+		'oldfieldname': u'notes',
+		'oldfieldtype': u'Text Editor',
+		'permlevel': 0
+	},
+
+	# DocField
+	{
+		'doctype': u'DocField',
+		'fieldtype': u'Section Break',
+		'label': u'Financials',
+		'oldfieldtype': u'Section Break',
+		'permlevel': 0
+	},
+
+	# DocField
+	{
+		'colour': u'White:FFF',
+		'doctype': u'DocField',
+		'fieldname': u'project_value',
+		'fieldtype': u'Currency',
+		'label': u'Project Value',
+		'oldfieldname': u'project_value',
+		'oldfieldtype': u'Currency',
 		'permlevel': 0,
-		'width': '50%'
+		'reqd': 0,
+		'trigger': u'Client'
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldtype': 'Section Break',
-		'idx': 18,
-		'oldfieldtype': 'Section Break',
-		'options': 'Simple',
+		'doctype': u'DocField',
+		'fieldname': u'est_material_cost',
+		'fieldtype': u'Currency',
+		'label': u'Estimated Material Cost',
+		'oldfieldname': u'est_material_cost',
+		'oldfieldtype': u'Currency',
+		'permlevel': 0,
+		'trigger': u'Client'
+	},
+
+	# DocField
+	{
+		'doctype': u'DocField',
+		'fieldtype': u'Column Break',
 		'permlevel': 0
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'notes',
-		'fieldtype': 'Text Editor',
-		'idx': 19,
-		'label': 'Notes',
-		'oldfieldname': 'notes',
-		'oldfieldtype': 'Text Editor',
+		'colour': u'White:FFF',
+		'doctype': u'DocField',
+		'fieldname': u'per_gross_margin',
+		'fieldtype': u'Currency',
+		'label': u'Gross Margin %',
+		'oldfieldname': u'per_gross_margin',
+		'oldfieldtype': u'Currency',
+		'permlevel': 0,
+		'reqd': 0
+	},
+
+	# DocField
+	{
+		'colour': u'White:FFF',
+		'doctype': u'DocField',
+		'fieldname': u'gross_margin_value',
+		'fieldtype': u'Currency',
+		'label': u'Gross Margin Value',
+		'oldfieldname': u'gross_margin_value',
+		'oldfieldtype': u'Currency',
+		'permlevel': 0,
+		'reqd': 0
+	},
+
+	# DocField
+	{
+		'doctype': u'DocField',
+		'fieldtype': u'Section Break',
+		'label': u'Customer Details',
+		'oldfieldtype': u'Section Break',
 		'permlevel': 0
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldtype': 'Section Break',
-		'idx': 20,
-		'label': 'Customer Details',
-		'oldfieldtype': 'Section Break',
-		'permlevel': 0
-	},
-
-	# DocField
-	{
-		'colour': 'White:FFF',
-		'description': 'Select name of Customer to whom project belongs',
-		'doctype': 'DocField',
-		'fieldname': 'customer',
-		'fieldtype': 'Link',
-		'idx': 21,
+		'colour': u'White:FFF',
+		'description': u'Select name of Customer to whom project belongs',
+		'doctype': u'DocField',
+		'fieldname': u'customer',
+		'fieldtype': u'Link',
 		'in_filter': 1,
-		'label': 'Customer',
-		'oldfieldname': 'customer',
-		'oldfieldtype': 'Link',
-		'options': 'Customer',
+		'label': u'Customer',
+		'oldfieldname': u'customer',
+		'oldfieldtype': u'Link',
+		'options': u'Customer',
 		'permlevel': 0,
 		'print_hide': 1,
 		'reqd': 0,
 		'search_index': 1,
-		'trigger': 'Client'
+		'trigger': u'Client'
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'customer_name',
-		'fieldtype': 'Data',
-		'idx': 22,
+		'doctype': u'DocField',
+		'fieldname': u'customer_name',
+		'fieldtype': u'Data',
 		'in_filter': 1,
-		'label': 'Customer Name',
-		'oldfieldname': 'customer_name',
-		'oldfieldtype': 'Data',
+		'label': u'Customer Name',
+		'oldfieldname': u'customer_name',
+		'oldfieldtype': u'Data',
 		'permlevel': 1,
-		'search_index': 0
+		'search_index': 1
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'customer_address',
-		'fieldtype': 'Small Text',
-		'idx': 23,
-		'label': 'Customer Address',
-		'oldfieldname': 'customer_address',
-		'oldfieldtype': 'Small Text',
+		'doctype': u'DocField',
+		'fieldname': u'customer_address',
+		'fieldtype': u'Small Text',
+		'label': u'Customer Address',
+		'oldfieldname': u'customer_address',
+		'oldfieldtype': u'Small Text',
 		'permlevel': 1
 	},
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'doctype': 'DocField',
-		'fieldname': 'contact_person',
-		'fieldtype': 'Link',
-		'idx': 24,
+		'colour': u'White:FFF',
+		'doctype': u'DocField',
+		'fieldname': u'contact_person',
+		'fieldtype': u'Link',
 		'in_filter': 1,
-		'label': 'Contact Person',
-		'oldfieldname': 'contact_person',
-		'oldfieldtype': 'Link',
+		'label': u'Contact Person',
+		'oldfieldname': u'contact_person',
+		'oldfieldtype': u'Link',
 		'permlevel': 0,
 		'reqd': 0,
-		'trigger': 'Client'
+		'trigger': u'Client'
 	},
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'doctype': 'DocField',
-		'fieldname': 'territory',
-		'fieldtype': 'Link',
-		'idx': 25,
+		'colour': u'White:FFF',
+		'doctype': u'DocField',
+		'fieldname': u'territory',
+		'fieldtype': u'Link',
 		'in_filter': 1,
-		'label': 'Territory',
-		'oldfieldname': 'territory',
-		'oldfieldtype': 'Link',
-		'options': 'Territory',
+		'label': u'Territory',
+		'oldfieldname': u'territory',
+		'oldfieldtype': u'Link',
+		'options': u'Territory',
 		'permlevel': 0,
 		'reqd': 0,
-		'search_index': 0,
-		'trigger': 'Client'
+		'trigger': u'Client'
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'contact_no',
-		'fieldtype': 'Data',
-		'idx': 26,
-		'label': 'Contact No',
-		'oldfieldname': 'contact_no',
-		'oldfieldtype': 'Data',
+		'doctype': u'DocField',
+		'fieldname': u'contact_no',
+		'fieldtype': u'Data',
+		'label': u'Contact No',
+		'oldfieldname': u'contact_no',
+		'oldfieldtype': u'Data',
 		'permlevel': 1
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'email_id',
-		'fieldtype': 'Data',
-		'idx': 27,
-		'label': 'Email Id',
-		'oldfieldname': 'email_id',
-		'oldfieldtype': 'Data',
+		'doctype': u'DocField',
+		'fieldname': u'email_id',
+		'fieldtype': u'Data',
+		'label': u'Email Id',
+		'oldfieldname': u'email_id',
+		'oldfieldtype': u'Data',
 		'permlevel': 1
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'customer_group',
-		'fieldtype': 'Link',
-		'idx': 28,
-		'label': 'Customer Group',
-		'oldfieldname': 'customer_group',
-		'oldfieldtype': 'Link',
-		'options': 'Customer Group',
-		'permlevel': 1,
-		'search_index': 0
+		'doctype': u'DocField',
+		'fieldname': u'customer_group',
+		'fieldtype': u'Link',
+		'label': u'Customer Group',
+		'oldfieldname': u'customer_group',
+		'oldfieldtype': u'Link',
+		'options': u'Customer Group',
+		'permlevel': 1
 	},
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'description': 'Important dates and commitments in your project life cycle',
-		'doctype': 'DocField',
-		'fieldtype': 'Section Break',
-		'idx': 29,
-		'label': 'Milestones',
-		'oldfieldtype': 'Section Break',
+		'colour': u'White:FFF',
+		'description': u'Important dates and commitments in your project life cycle',
+		'doctype': u'DocField',
+		'fieldtype': u'Section Break',
+		'label': u'Milestones',
+		'oldfieldtype': u'Section Break',
 		'permlevel': 0
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'project_milestones',
-		'fieldtype': 'Table',
-		'idx': 30,
-		'label': 'Project Milestones',
-		'oldfieldname': 'project_milestones',
-		'oldfieldtype': 'Table',
-		'options': 'Project Milestone',
+		'doctype': u'DocField',
+		'fieldname': u'project_milestones',
+		'fieldtype': u'Table',
+		'label': u'Project Milestones',
+		'oldfieldname': u'project_milestones',
+		'oldfieldtype': u'Table',
+		'options': u'Project Milestone',
 		'permlevel': 0
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'trash_reason',
-		'fieldtype': 'Small Text',
+		'doctype': u'DocField',
+		'fieldname': u'trash_reason',
+		'fieldtype': u'Small Text',
 		'hidden': 1,
-		'idx': 31,
-		'label': 'Trash Reason',
-		'oldfieldname': 'trash_reason',
-		'oldfieldtype': 'Small Text',
+		'label': u'Trash Reason',
+		'oldfieldname': u'trash_reason',
+		'oldfieldtype': u'Small Text',
+		'permlevel': 0,
+		'print_hide': 1
+	},
+
+	# DocField
+	{
+		'colour': u'White:FFF',
+		'doctype': u'DocField',
+		'fieldname': u'file_list',
+		'fieldtype': u'Small Text',
+		'hidden': 1,
+		'label': u'File List',
+		'no_copy': 1,
 		'permlevel': 0,
 		'print_hide': 1
 	}
diff --git a/erpnext/selling/doctype/sales_common/sales_common.js b/erpnext/selling/doctype/sales_common/sales_common.js
index deec159..192875c 100644
--- a/erpnext/selling/doctype/sales_common/sales_common.js
+++ b/erpnext/selling/doctype/sales_common/sales_common.js
@@ -100,14 +100,14 @@
 		'grand_total':	'Grand Total', 'rounded_total': 'Rounded Total', 'in_words': 'In Words'}
 	par_cols_export = {'grand_total_export': 'Grand Total', 'rounded_total_export':	'Rounded Total', 'in_words_export':	'In Words'};
 
-	for (d in par_cols_base) cur_frm.fields_dict[d].label_area.innerHTML = par_cols_base[d]+' (' + base_curr + ')';
-	for (d in par_cols_export) cur_frm.fields_dict[d].label_area.innerHTML = par_cols_export[d]+' (' + doc.currency + ')';
-	cur_frm.fields_dict['conversion_rate'].label_area.innerHTML = "Conversion Rate (" + doc.currency +' -> '+ base_curr + ')';
-	cur_frm.fields_dict['plc_conversion_rate'].label_area.innerHTML = 'Price List Currency Conversion Rate (' + doc.price_list_currency +' -> '+ base_curr + ')';
+	for (d in par_cols_base) cur_frm.fields_dict[d].label_span.innerHTML = par_cols_base[d]+' (' + base_curr + ')';
+	for (d in par_cols_export) cur_frm.fields_dict[d].label_span.innerHTML = par_cols_export[d]+' (' + doc.currency + ')';
+	cur_frm.fields_dict['conversion_rate'].label_span.innerHTML = "Conversion Rate (" + doc.currency +' -> '+ base_curr + ')';
+	cur_frm.fields_dict['plc_conversion_rate'].label_span.innerHTML = 'Price List Currency Conversion Rate (' + doc.price_list_currency +' -> '+ base_curr + ')';
 
 	if (doc.doctype == 'Receivable Voucher') {
-		cur_frm.fields_dict['total_advance'].label_area.innerHTML = 'Total Advance (' + base_curr + ')';
-		cur_frm.fields_dict['outstanding_amount'].label_area.innerHTML = 'Outstanding Amount (' + base_curr + ')';
+		cur_frm.fields_dict['total_advance'].label_span.innerHTML = 'Total Advance (' + base_curr + ')';
+		cur_frm.fields_dict['outstanding_amount'].label_span.innerHTML = 'Outstanding Amount (' + base_curr + ')';
 	}
 }
 
diff --git a/erpnext/setup/page/import_data/import_data.js b/erpnext/setup/page/import_data/import_data.js
index b3b0a49..734c16d 100644
--- a/erpnext/setup/page/import_data/import_data.js
+++ b/erpnext/setup/page/import_data/import_data.js
@@ -47,7 +47,7 @@
 								
 								dt.onclick = function(){ 
 									var ovr = $('input[name="overwrite"]:checked').length;
-										window.location = webnotes.request.url + '?cmd=get_template&dt=' + this.nm + (ovr ? '&overwrite=1' : '');
+										window.location = wn.request.url + '?cmd=get_template&dt=' + this.nm + (ovr ? '&overwrite=1' : '');
 								}
 							}
 						}	
diff --git a/js/all-app.js b/js/all-app.js
index 356ac16..815a3db 100644
--- a/js/all-app.js
+++ b/js/all-app.js
@@ -267,7 +267,7 @@
  *	lib/js/legacy/globals.js
  */
 wn.provide('wn.widgets.form');wn.provide('wn.widgets.report');wn.provide('wn.utils');wn.provide('wn.model');wn.provide('wn.profile');wn.provide('wn.session');wn.provide('_f');wn.provide('_p');wn.provide('_r');wn.provide('_c');wn.provide('_e');wn.provide('_startup_data')
-wn.settings.no_history=1;var NEWLINE='\n';var login_file='';var version='v170';var profile=null;var session={};var is_testing=false;var user=null;var user_defaults=null;var user_roles=null;var user_fullname=null;var user_email=null;var user_img={};var home_page=null;var hide_autosuggest=null;var page_body=null;var pscript={};var selector=null;var top_index=91;var _f={};var _p={};var _e={};var _r={};var FILTER_SEP='\1';var frms={};var cur_frm=null;var pscript={};var validated=true;var validation_message='';var tinymce_loaded=null;var cur_autosug=null;
+wn.settings.no_history=1;var NEWLINE='\n';var login_file='';var version='v170';var profile=null;var session={};var is_testing=false;var user=null;var user_defaults=null;var user_roles=null;var user_fullname=null;var user_email=null;var user_img={};var home_page=null;var page_body=null;var pscript={};var selector=null;var top_index=91;var _f={};var _p={};var _e={};var _r={};var FILTER_SEP='\1';var frms={};var cur_frm=null;var pscript={};var validated=true;var validation_message='';var tinymce_loaded=null;
 /*
  *	lib/js/legacy/utils/datatype.js
  */
@@ -473,7 +473,7 @@
 function $c_obj_csv(doclist,method,arg){var args={}
 args.cmd='runserverobj';args.as_csv=1;args.method=method;args.arg=arg;if(doclist.substr)
 args.doctype=doclist;else
-args.docs=compress_doclist(doclist);open_url_post(webnotes.request.url,args);}
+args.docs=compress_doclist(doclist);open_url_post(wn.request.url,args);}
 function open_url_post(URL,PARAMS,new_window){var temp=document.createElement("form");temp.action=URL;temp.method="POST";temp.style.display="none";if(new_window){temp.target='_blank';}
 for(var x in PARAMS){var opt=document.createElement("textarea");opt.name=x;opt.value=PARAMS[x];temp.appendChild(opt);}
 document.body.appendChild(temp);temp.submit();return temp;}
@@ -528,12 +528,12 @@
 var no_value_fields=['Section Break','Column Break','HTML','Table','FlexTable','Button','Image'];var codeid=0;var code_editors={};function Field(){this.with_label=1;}
 Field.prototype.make_body=function(){var ischk=(this.df.fieldtype=='Check'?1:0);if(this.parent)
 this.wrapper=$a(this.parent,(this.with_label?'div':'span'));else
-this.wrapper=document.createElement((this.with_label?'div':'span'));this.label_area=$a(this.wrapper,'div','',{margin:'8px 0px 2px 0px'});if(ischk&&!this.in_grid){this.input_area=$a(this.label_area,'span','',{marginRight:'4px'});this.disp_area=$a(this.label_area,'span','',{marginRight:'4px'});}
+this.wrapper=document.createElement((this.with_label?'div':'span'));this.label_area=$a(this.wrapper,'div','',{margin:'0px 0px 2px 0px'});if(ischk&&!this.in_grid){this.input_area=$a(this.label_area,'span','',{marginRight:'4px'});this.disp_area=$a(this.label_area,'span','',{marginRight:'4px'});}
 if(this.with_label){this.label_span=$a(this.label_area,'span','field_label')
 this.label_icon=$a(this.label_area,'img','',{margin:'-3px 4px -3px 4px'});$dh(this.label_icon);this.label_icon.src='lib/images/icons/error.gif';this.label_icon.title='Mandatory value needs to be entered';this.suggest_icon=$a(this.label_area,'img','',{margin:'-3px 4px -3px 0px'});$dh(this.suggest_icon);this.suggest_icon.src='lib/images/icons/bullet_arrow_down.png';this.suggest_icon.title='With suggestions';}else{this.label_span=$a(this.label_area,'span','',{marginRight:'4px'})
 $dh(this.label_area);}
 if(!this.input_area){this.input_area=$a(this.wrapper,(this.with_label?'div':'span'));this.disp_area=$a(this.wrapper,(this.with_label?'div':'span'));}
-if(this.in_grid){if(this.label_area)$dh(this.label_area);}else{this.input_area.className='input_area';$y(this.wrapper,{marginBottom:'4px'});this.set_description();}
+if(this.in_grid){if(this.label_area)$dh(this.label_area);}else{this.input_area.className='input_area';$y(this.wrapper,{marginBottom:'9px'});this.set_description();}
 if(this.onmake)this.onmake();}
 Field.prototype.set_max_width=function(){var no_max=['Code','Text Editor','Text','Table','HTML']
 if(this.wrapper&&this.layout_cell&&this.layout_cell.parentNode.cells&&this.layout_cell.parentNode.cells.length==1&&!in_list(no_max,this.df.fieldtype)){$y(this.wrapper,{paddingRight:'50%'});}}
@@ -628,7 +628,7 @@
 if(me.btn1)me.btn1.onclick=function(){if(me.txt.value&&me.df.options){loaddoc(me.df.options,me.txt.value);}}
 me.can_create=0;if((!me.not_in_form)&&in_list(profile.can_create,me.df.options)){me.can_create=1;me.btn2.onclick=function(){var on_save_callback=function(new_rec){if(new_rec){var d=_f.calling_doc_stack.pop();locals[d[0]][d[1]][me.df.fieldname]=new_rec;me.refresh();if(me.grid)me.grid.refresh();me.run_trigger();}}
 _f.calling_doc_stack.push([me.doctype,me.docname]);new_doc(me.df.options,me.on_new,1,on_save_callback,me.doctype,me.docname,me.frm.not_in_container);}}else{$dh(me.btn2);$y($td(me.tab,0,2),{width:'0px'});}}
-LinkField.prototype.set_input_value=function(val){var me=this;me.refresh_label_icon();if(me.not_in_form){return;}
+LinkField.prototype.set_input_value=function(val){var me=this;me.refresh_label_icon();if(me.not_in_form){$(this.txt).val(val);return;}
 if(cur_frm){if(val==locals[me.doctype][me.docname][me.df.fieldname]){me.set(val);me.run_trigger();return;}}
 me.set(val);if(_f.cur_grid_cell)
 _f.cur_grid_cell.grid.cell_deselect();if(!val){me.run_trigger();return;}
@@ -752,7 +752,7 @@
 this.set_postion=function(){var d=get_screen_dims();this.wrapper.style.left=((d.w-cint(this.wrapper.style.width))/2)+'px';this.wrapper.style.top=(get_scroll_top()+60)+'px';top_index++;$y(this.wrapper,{zIndex:top_index});}
 this.show=function(){if(this.display)return;this.set_postion()
 $ds(this.wrapper);freeze();this.display=true;cur_dialog=this;if(this.onshow)this.onshow();}
-this.hide=function(){if(this.onhide)this.onhide();unfreeze();$dh(this.wrapper);if(cur_autosug)cur_autosug.clearSuggestions();this.display=false;cur_dialog=null;}
+this.hide=function(){if(this.onhide)this.onhide();unfreeze();$dh(this.wrapper);this.display=false;cur_dialog=null;}
 this.no_cancel=function(){$dh(this.cancel_img);}
 if(opts)this.make();}
 wn.widgets.Dialog.prototype=new wn.widgets.FieldGroup();$(document).bind('keydown',function(e){if(cur_dialog&&!cur_dialog.no_cancel_flag&&e.which==27){cur_dialog.hide();}});
@@ -890,7 +890,7 @@
 LayoutRow.prototype.show=function(){$ds(this.wrapper);}
 LayoutRow.prototype.addCell=function(wid){var lc=new LayoutCell(this.layout,this,wid);this.mycells[this.mycells.length]=lc;return lc;}
 function LayoutCell(layout,layoutRow,width){if(width){var w=width+'';if(w.substr(w.length-2,2)!='px'){if(w.substr(w.length-1,1)!="%"){width=width+'%'};}}
-this.width=width;this.layout=layout;var cidx=layoutRow.row.cells.length;this.cell=layoutRow.row.insertCell(cidx);this.cell.style.verticalAlign='top';this.set_width(layoutRow.row,width);var h=$a(this.cell,'div','',{padding:(layout.with_border?'0px 8px':'0px')});this.wrapper=$a(this.cell,'div','',{padding:(layout.with_border?'8px':'8px 0px')});layout.cur_cell=this.wrapper;layout.cur_cell.header=h;}
+this.width=width;this.layout=layout;var cidx=layoutRow.row.cells.length;this.cell=layoutRow.row.insertCell(cidx);this.cell.style.verticalAlign='top';this.set_width(layoutRow.row,width);var h=$a(this.cell,'div','',{padding:(layout.with_border?'0px 8px':'0px')});this.wrapper=$a(this.cell,'div','',{padding:(layout.with_border?'8px':'0px')});layout.cur_cell=this.wrapper;layout.cur_cell.header=h;}
 LayoutCell.prototype.set_width=function(row,width){var w=100;var n_cells=row.cells.length;var cells_with_no_width=n_cells;if(width){$y(row.cells[n_cells-1],{width:cint(width)+'%'})}else{row.cells[n_cells-1].estimated_width=1;}
 for(var i=0;i<n_cells;i++){if(!row.cells[i].estimated_width){w=w-cint(row.cells[i].style.width);cells_with_no_width--;}}
 for(var i=0;i<n_cells;i++){if(row.cells[i].estimated_width)
@@ -903,8 +903,7 @@
 function TabbedPage(parent,only_labels){this.tabs={};this.items=this.tabs
 this.cur_tab=null;this.label_wrapper=$a(parent,'div','box_label_wrapper',{marginTop:'16px'});this.label_body=$a(this.label_wrapper,'div','box_label_body');this.label_area=$a(this.label_body,'ul','box_tabs');if(!only_labels)this.body_area=$a(parent,'div','',{backgroundColor:'#FFF'});else this.body_area=null;this.add_item=function(label,onclick,no_body,with_heading){this.add_tab(label,onclick,no_body,with_heading);return this.items[label];}}
 TabbedPage.prototype.add_tab=function(n,onshow,no_body,with_heading){var tab=$a(this.label_area,'li');tab.label=$a(tab,'a');tab.label.innerHTML=n;if(this.body_area&&!no_body){tab.tab_body=$a(this.body_area,'div');$dh(tab.tab_body);tab.body=tab.tab_body;}else{tab.tab_body=null;}
-tab.onshow=onshow;var me=this;tab.collapse=function(){if(this.tab_body)$dh(this.tab_body);this.className='';if(hide_autosuggest)
-hide_autosuggest();}
+tab.onshow=onshow;var me=this;tab.collapse=function(){if(this.tab_body)$dh(this.tab_body);this.className='';}
 tab.set_selected=function(){if(me.cur_tab)me.cur_tab.collapse();this.className='box_tab_selected';$(this).css('opacity',1);me.cur_tab=this;}
 tab.expand=function(arg){this.set_selected();if(this.tab_body)$ds(this.tab_body);if(this.onshow)this.onshow(arg);}
 tab.onmouseover=function(){if(me.cur_tab!=this)this.className='box_tab_mouseover';}
@@ -997,7 +996,7 @@
 args.cmd='webnotes.widgets.query_builder.runquery_csv';if(is_simple)
 args.simple_query=q;else
 args.query=q;args.sc_id=sc_id?sc_id:'';args.filter_values=filter_values?filter_values:'';if(colnames)
-args.colnames=colnames.join(',');args.report_name=report_name?report_name:'';open_url_post(webnotes.request.url,args);}
+args.colnames=colnames.join(',');args.report_name=report_name?report_name:'';open_url_post(wn.request.url,args);}
 /*
  *	lib/js/legacy/webpage/history.js
  */
@@ -1121,14 +1120,14 @@
  *	lib/js/legacy/webpage/uploader.js
  */
 var uploaders={};var upload_frame_count=0;Uploader=function(parent,args,callback){var id='frame'+upload_frame_count;upload_frame_count++;this.callback=callback;var div=$a(parent,'div');div.innerHTML='<iframe id="'+id+'" name="'+id+'" src="blank.html" \
-  style="width:0px; height:0px; border:0px"></iframe>';var div=$a(parent,'div');div.innerHTML='<form method="POST" enctype="multipart/form-data" action="'+webnotes.request.url+'" target="'+id+'"></form>';var ul_form=div.childNodes[0];var f_list=[];var inp_fdata=$a_input($a(ul_form,'span'),'file',{name:'filedata'},{marginLeft:'7px'});if(!('cmd'in args)){var inp=$a_input($a(ul_form,'span'),'hidden',{name:'cmd'});inp.value='uploadfile';}
+  style="width:0px; height:0px; border:0px"></iframe>';var div=$a(parent,'div');div.innerHTML='<form method="POST" enctype="multipart/form-data" action="'+wn.request.url+'" target="'+id+'"></form>';var ul_form=div.childNodes[0];var f_list=[];var inp_fdata=$a_input($a(ul_form,'span'),'file',{name:'filedata'},{marginLeft:'7px'});if(!('cmd'in args)){var inp=$a_input($a(ul_form,'span'),'hidden',{name:'cmd'});inp.value='uploadfile';}
 var inp=$a_input($a(ul_form,'span'),'hidden',{name:'uploader_id'});inp.value=id;var inp=$a_input($a(ul_form,'span'),'submit',null,{marginLeft:'7px'});inp.value='Upload';$y(inp,{width:'80px'});for(var key in args){var inp=$a_input($a(ul_form,'span'),'hidden',{name:key});inp.value=args[key];}
 uploaders[id]=this;}
 function upload_callback(id,fid){uploaders[id].callback(fid);}
 /*
  *	lib/js/legacy/webpage/page.js
  */
-var stylesheets=[];function Page(page_name,content){var me=this;this.name=page_name;this.trigger=function(event){try{if(pscript[event+'_'+this.name])
+function Page(page_name,content){var me=this;this.name=page_name;this.trigger=function(event){try{if(pscript[event+'_'+this.name])
 pscript[event+'_'+this.name](me.wrapper);if(me.wrapper[event]){me.wrapper[event](me.wrapper);}}catch(e){console.log(e);}}
 this.page_show=function(){set_title(me.doc.title?me.doc.title:me.name);if(!me.onload_complete){me.trigger('onload');me.onload_complete=true;}
 me.trigger('onshow');cur_frm=null;}
@@ -1137,11 +1136,10 @@
 this.wrapper.innerHTML=content;return this;}
 function render_page(page_name,menuitem){if(!page_name)return;if((!locals['Page'])||(!locals['Page'][page_name])){loadpage('_home');return;}
 var pdoc=locals['Page'][page_name];if(pdoc.style)set_style(pdoc.style)
-if(pdoc.stylesheet){set_style(locals.Stylesheet[pdoc.stylesheet].stylesheet);stylesheets.push(pdoc.stylesheet);}
 var p=new Page(page_name,pdoc._Page__content?pdoc._Page__content:pdoc.content);var script=pdoc.__script?pdoc.__script:pdoc.script;p.doc=pdoc;if(script){eval(script);}
 page_body.change_to(page_name);return p;}
 function refresh_page(page_name){var fn=function(r,rt){render_page(page_name)}
-$c('webnotes.widgets.page.getpage',{'name':page_name,stylesheets:JSON.stringify(stylesheets)},fn);}
+$c('webnotes.widgets.page.getpage',{'name':page_name},fn);}
 /*
  *	lib/js/legacy/wn/page_layout.js
  */
@@ -1374,12 +1372,12 @@
 var no_value_fields=['Section Break','Column Break','HTML','Table','FlexTable','Button','Image'];var codeid=0;var code_editors={};function Field(){this.with_label=1;}
 Field.prototype.make_body=function(){var ischk=(this.df.fieldtype=='Check'?1:0);if(this.parent)
 this.wrapper=$a(this.parent,(this.with_label?'div':'span'));else
-this.wrapper=document.createElement((this.with_label?'div':'span'));this.label_area=$a(this.wrapper,'div','',{margin:'8px 0px 2px 0px'});if(ischk&&!this.in_grid){this.input_area=$a(this.label_area,'span','',{marginRight:'4px'});this.disp_area=$a(this.label_area,'span','',{marginRight:'4px'});}
+this.wrapper=document.createElement((this.with_label?'div':'span'));this.label_area=$a(this.wrapper,'div','',{margin:'0px 0px 2px 0px'});if(ischk&&!this.in_grid){this.input_area=$a(this.label_area,'span','',{marginRight:'4px'});this.disp_area=$a(this.label_area,'span','',{marginRight:'4px'});}
 if(this.with_label){this.label_span=$a(this.label_area,'span','field_label')
 this.label_icon=$a(this.label_area,'img','',{margin:'-3px 4px -3px 4px'});$dh(this.label_icon);this.label_icon.src='lib/images/icons/error.gif';this.label_icon.title='Mandatory value needs to be entered';this.suggest_icon=$a(this.label_area,'img','',{margin:'-3px 4px -3px 0px'});$dh(this.suggest_icon);this.suggest_icon.src='lib/images/icons/bullet_arrow_down.png';this.suggest_icon.title='With suggestions';}else{this.label_span=$a(this.label_area,'span','',{marginRight:'4px'})
 $dh(this.label_area);}
 if(!this.input_area){this.input_area=$a(this.wrapper,(this.with_label?'div':'span'));this.disp_area=$a(this.wrapper,(this.with_label?'div':'span'));}
-if(this.in_grid){if(this.label_area)$dh(this.label_area);}else{this.input_area.className='input_area';$y(this.wrapper,{marginBottom:'4px'});this.set_description();}
+if(this.in_grid){if(this.label_area)$dh(this.label_area);}else{this.input_area.className='input_area';$y(this.wrapper,{marginBottom:'9px'});this.set_description();}
 if(this.onmake)this.onmake();}
 Field.prototype.set_max_width=function(){var no_max=['Code','Text Editor','Text','Table','HTML']
 if(this.wrapper&&this.layout_cell&&this.layout_cell.parentNode.cells&&this.layout_cell.parentNode.cells.length==1&&!in_list(no_max,this.df.fieldtype)){$y(this.wrapper,{paddingRight:'50%'});}}
@@ -1474,7 +1472,7 @@
 if(me.btn1)me.btn1.onclick=function(){if(me.txt.value&&me.df.options){loaddoc(me.df.options,me.txt.value);}}
 me.can_create=0;if((!me.not_in_form)&&in_list(profile.can_create,me.df.options)){me.can_create=1;me.btn2.onclick=function(){var on_save_callback=function(new_rec){if(new_rec){var d=_f.calling_doc_stack.pop();locals[d[0]][d[1]][me.df.fieldname]=new_rec;me.refresh();if(me.grid)me.grid.refresh();me.run_trigger();}}
 _f.calling_doc_stack.push([me.doctype,me.docname]);new_doc(me.df.options,me.on_new,1,on_save_callback,me.doctype,me.docname,me.frm.not_in_container);}}else{$dh(me.btn2);$y($td(me.tab,0,2),{width:'0px'});}}
-LinkField.prototype.set_input_value=function(val){var me=this;me.refresh_label_icon();if(me.not_in_form){return;}
+LinkField.prototype.set_input_value=function(val){var me=this;me.refresh_label_icon();if(me.not_in_form){$(this.txt).val(val);return;}
 if(cur_frm){if(val==locals[me.doctype][me.docname][me.df.fieldname]){me.set(val);me.run_trigger();return;}}
 me.set(val);if(_f.cur_grid_cell)
 _f.cur_grid_cell.grid.cell_deselect();if(!val){me.run_trigger();return;}
@@ -1645,7 +1643,7 @@
 this.layout.wrapper.style.backgroundColor='#'+this.meta.colour.split(':')[1];this.setup_fields_std();if(this.meta.description)
 this.add_description();}
 _f.Frm.prototype.add_description=function(){if(!wn.md2html){wn.require('lib/js/lib/showdown.js');wn.md2html=new Showdown.converter();}
-this.description_wrapper=$a(this.page_layout.footer.help_area,'div','info-box',{marginTop:'10px'},wn.md2html.makeHtml('#### Help\n\n'+this.meta.description));}
+this.description_wrapper=$a(this.page_layout.footer.help_area,'div','well',{marginTop:'11px'},wn.md2html.makeHtml('#### Help\n\n'+this.meta.description));}
 _f.Frm.prototype.setup_print=function(){var fl=getchildren('DocFormat',this.meta.name,'formats','DocType');var l=[];this.default_format='Standard';if(fl.length){this.default_format=fl[0].format;for(var i=0;i<fl.length;i++)
 l.push(fl[i].format);}
 if(this.meta.default_print_format)
@@ -1682,8 +1680,7 @@
 cur_frm.set_print_heading(cur_frm.doc.select_print_heading)
 if(user!='Guest'){$di(this.view_btn_wrapper);if(cur_frm.doc.__archived){$dh(this.view_btn_wrapper);}}else{$dh(this.view_btn_wrapper);$dh(this.print_close_btn);}
 _p.build(this.default_format,print_callback,null,1);}
-_f.Frm.prototype.hide=function(){$dh(this.wrapper);this.display=0;if(hide_autosuggest)
-hide_autosuggest();}
+_f.Frm.prototype.hide=function(){$dh(this.wrapper);this.display=0;}
 _f.Frm.prototype.show_the_frm=function(){if(this.parent.last_displayed&&this.parent.last_displayed!=this){this.parent.last_displayed.defocus_rest();this.parent.last_displayed.hide();}
 if(this.wrapper&&this.wrapper.style.display.toLowerCase()=='none'){$ds(this.wrapper);this.display=1;}
 if(this.meta.in_dialog&&!this.parent.dialog.display){if(!this.meta.istable)
@@ -1788,21 +1785,13 @@
 this.cell.show();this.set_hidden=this.df.hidden;}}}
 _f.SectionBreak=function(){this.set_input=function(){};}
 _f.SectionBreak.prototype.make_row=function(){this.row=this.df.label?this.frm.layout.addrow():this.frm.layout.addsubrow();}
-_f.SectionBreak.prototype.make_collapsible=function(head){var me=this;var div=$a(head,'div','',{paddingBottom:'3px',borderBottom:'1px solid #AAA'});if(cur_frm.meta.in_dialog)$y(div,{marginLeft:'8px'});this.chk=$a_input(div,'checkbox',null,{marginRight:'8px'})
-if(this.df.label){this.label=$a(div,'h3','',{display:'inline'},this.df.label);}
-var d=this.df.description;if(d){this.desc_area=$a(div,'span','field_description',{marginLeft:'8px'});this.desc_area.innerHTML=d.substr(0,50)+(d.length>50?'...':'');}
-var span=$a(div,'i','icon-arrow-up',{cssFloat:'right',marginRight:'8px',cursor:'pointer',verticalAlign:'middle',marginTop:'7px'})
-span.title='Go to top';span.onclick=function(){scroll(0,0);}
-this.chk.onclick=function(){if(this.checked)me.expand();else me.collapse();}
-this.expand=function(){$(me.row.main_body).slideDown();}
-this.collapse=function(){$(me.row.main_body).slideUp();}
-if(me.frm.section_count){$dh(this.row.main_body);}else{this.chk.checked=true;}}
-_f.SectionBreak.prototype.make_simple_section=function(with_header){this.wrapper=$a(this.row.main_head,'div','',{margin:'8px 8px 0px 0px'});var me=this;if(this.df.colour){var col=this.df.colour.split(':')[1];if(col!='FFF'){$y(this.row.sub_wrapper,{margin:'8px',padding:'0px',backgroundColor:('#'+col)});}}
-if(with_header){if(this.df.label&&this.df.options!='Simple'){this.make_collapsible(this.wrapper);}else{$y(this.wrapper,{paddingBottom:'4px'});if(this.df.label){$a(this.wrapper,'h3','',{},this.df.label);}}}
-$y(this.row.body,{marginLeft:'17px'});}
 _f.SectionBreak.prototype.add_to_sections=function(){this.sec_id=this.frm.sections.length;this.frm.sections[this.sec_id]=this;this.frm.sections_by_label[this.df.label]=this;}
 _f.cur_sec_header=null;_f.SectionBreak.prototype.make_body=function(){if((!this.perm[this.df.permlevel])||(!this.perm[this.df.permlevel][READ])||this.df.hidden){return;}
-var me=this;if(this.df){this.make_row();this.make_simple_section(1,1);}}
+this.make_row();this.wrapper=$a(this.row.main_head,'div');if(this.df.label){if(!this.df.description)this.df.description='';$(this.wrapper).html(repl('<div class="form-section-break">\
+   <h3>%(label)s</h3>\
+   <div class="help">%(description)s</div>\
+   </div>',this.df));}else{$(this.wrapper).html('<div class="form-section-break"></div>');}
+$y(this.row.body,{marginLeft:'17px'});}
 _f.SectionBreak.prototype.refresh=function(layout){var fn=this.df.fieldname?this.df.fieldname:this.df.label;if(fn)
 this.df=get_field(this.doctype,fn,this.docname);if(this.set_hidden!=this.df.hidden){if(this.df.hidden){if(this.frm.meta.section_style=='Tabbed'){$dh(this.mytab);}else if(this.tray_item)
 this.tray_item.hide();if(this.row)this.row.hide();}else{if(this.frm.meta.section_style=='Tabbed'){$di(this.mytab);}else if(this.tray_item)
@@ -1810,10 +1799,10 @@
 this.set_hidden=this.df.hidden;}}
 _f.ImageField=function(){this.images={};}
 _f.ImageField.prototype=new Field();_f.ImageField.prototype.onmake=function(){this.no_img=$a(this.wrapper,'div','no_img');this.no_img.innerHTML="No Image";$dh(this.no_img);}
-_f.ImageField.prototype.get_image_src=function(doc){if(doc.file_list){file=doc.file_list.split(',');extn=file[0].split('.');extn=extn[extn.length-1].toLowerCase();var img_extn_list=['gif','jpg','bmp','jpeg','jp2','cgm','ief','jpm','jpx','png','tiff','jpe','tif'];if(in_list(img_extn_list,extn)){var src=webnotes.request.url+"?cmd=downloadfile&file_id="+file[1];}}else{var src="";}
+_f.ImageField.prototype.get_image_src=function(doc){if(doc.file_list){file=doc.file_list.split(',');extn=file[0].split('.');extn=extn[extn.length-1].toLowerCase();var img_extn_list=['gif','jpg','bmp','jpeg','jp2','cgm','ief','jpm','jpx','png','tiff','jpe','tif'];if(in_list(img_extn_list,extn)){var src=wn.request.url+"?cmd=downloadfile&file_id="+file[1];}}else{var src="";}
 return src;}
 _f.ImageField.prototype.onrefresh=function(){var me=this;if(!this.images[this.docname])this.images[this.docname]=$a(this.wrapper,'img');else $di(this.images[this.docname]);var img=this.images[this.docname]
-for(var dn in this.images)if(dn!=this.docname)$dh(this.images[dn]);var doc=locals[this.frm.doctype][this.frm.docname];if(!this.df.options)var src=this.get_image_src(doc);else var src=webnotes.request.url+'?cmd=get_file&fname='+this.df.options+"&__account="+account_id+(__sid150?("&sid150="+__sid150):'');if(src){$dh(this.no_img);if(img.getAttribute('src')!=src)img.setAttribute('src',src);canvas=this.wrapper;canvas.img=this.images[this.docname];canvas.style.overflow="auto";$w(canvas,"100%");if(!this.col_break_width)this.col_break_width='100%';var allow_width=cint(1000*(cint(this.col_break_width)-10)/100);if((!img.naturalWidth)||cint(img.naturalWidth)>allow_width)
+for(var dn in this.images)if(dn!=this.docname)$dh(this.images[dn]);var doc=locals[this.frm.doctype][this.frm.docname];if(!this.df.options)var src=this.get_image_src(doc);else var src=wn.request.url+'?cmd=get_file&fname='+this.df.options+"&__account="+account_id+(__sid150?("&sid150="+__sid150):'');if(src){$dh(this.no_img);if(img.getAttribute('src')!=src)img.setAttribute('src',src);canvas=this.wrapper;canvas.img=this.images[this.docname];canvas.style.overflow="auto";$w(canvas,"100%");if(!this.col_break_width)this.col_break_width='100%';var allow_width=cint(1000*(cint(this.col_break_width)-10)/100);if((!img.naturalWidth)||cint(img.naturalWidth)>allow_width)
 $w(img,allow_width+'px');}else{$ds(this.no_img);}}
 _f.ImageField.prototype.set_disp=function(val){}
 _f.ImageField.prototype.set=function(val){}
@@ -1864,7 +1853,7 @@
 var me=this;if(cell.cellIndex){var ft=hc.fieldtype;if(ft=='Link'&&cur_frm.doc.docstatus<1)ft='Data';$s(cell.div,v,ft,hc.options);}else{cell.div.style.padding='2px';cell.div.style.textAlign='left';cell.innerHTML='';var t=make_table(cell,1,3,'60px',['20px','20px','20px'],{verticalAlign:'middle',padding:'2px'});$y($td(t,0,0),{paddingLeft:'4px'});$td(t,0,0).innerHTML=cell.row.rowIndex+1;if(cur_frm.editable&&this.can_edit){var ed=$a($td(t,0,1),'i','icon-edit',{cursor:'pointer'});ed.cell=cell;ed.title='Edit Row';ed.onclick=function(){_f.cur_grid=me;_f.cur_grid_ridx=this.cell.row.rowIndex;_f.edit_record(me.doctype,this.cell.row.docname,1);}}else{cell.div.innerHTML=(cell.row.rowIndex+1);cell.div.style.cursor='default';cell.div.onclick=function(){}}}}
 $(document).bind('click',function(e){var is_target_toolbar=function(){return $(e.target).parents('.grid_tbarlinks').length;}
 var is_target_input=function(){return $(e.target).parents().get().indexOf(_f.cur_grid_cell)!=-1;}
-if(_f.cur_grid_cell&&!is_target_input()&&!is_target_toolbar()){if(!(text_dialog&&text_dialog.display)&&!datepicker_active&&!(selector&&selector.display)&&!(cur_autosug)){_f.cur_grid_cell.grid.cell_deselect();}}});_f.Grid.prototype.cell_deselect=function(){if(_f.cur_grid_cell){var c=_f.cur_grid_cell;c.grid.remove_template(c);c.div.className='grid_cell_div';if(c.is_odd)c.div.style.border='2px solid '+c.grid.alt_row_bg;else c.div.style.border='2px solid #FFF';_f.cur_grid_cell=null;_f.cur_grid=null;}}
+if(_f.cur_grid_cell&&!is_target_input()&&!is_target_toolbar()){if(!(text_dialog&&text_dialog.display)&&!datepicker_active&&!(selector&&selector.display)){_f.cur_grid_cell.grid.cell_deselect();}}});_f.Grid.prototype.cell_deselect=function(){if(_f.cur_grid_cell){var c=_f.cur_grid_cell;c.grid.remove_template(c);c.div.className='grid_cell_div';if(c.is_odd)c.div.style.border='2px solid '+c.grid.alt_row_bg;else c.div.style.border='2px solid #FFF';_f.cur_grid_cell=null;_f.cur_grid=null;}}
 _f.Grid.prototype.cell_select=function(cell,ri,ci){if(ri!=null&&ci!=null)
 cell=this.tab.rows[ri].cells[ci];var hc=this.head_row.cells[cell.cellIndex];if(!hc.template){this.make_template(hc);}
 hc.template.perm=this.field?this.field.perm:hc.perm;if(hc.fieldname&&hc.template.get_status()=='Write'){this.cell_deselect();cell.div.style.border='2px solid #88F';_f.cur_grid_cell=cell;this.add_template(cell);}}
@@ -2025,14 +2014,10 @@
 if(emailfrom&&!validate_email(emailfrom)){msgprint('error:'+emailfrom+' is not a valid email id. To change the default please click on Profile on the top right of the screen and change it.');return;}
 if(!valid)return;var cc=emailfrom;if(!emailfrom){emailfrom=wn.control_panel.auto_email_id;cc='';}
 sendmail(emailto,emailfrom,emailfrom,d.widgets['Subject'].value,d.widgets['Message'].value,sel_val(cur_frm.print_sel),d.widgets['Send With Attachments'].checked);_e.dialog.hide();}
-d.onhide=function(){hide_autosuggest();}
-d.make_body([['Data','To','Example: abc@hotmail.com, xyz@yahoo.com'],['Select','Format'],['Data','Subject'],['Data','From','Optional'],['Check','Send With Attachments','Will send all attached documents (if any)'],['Text','Message'],['Button','Send',email_go]]);d.widgets['From'].value=(user_email?user_email:'');$td(d.rows['Format'].tab,0,1).cur_sel=d.widgets['Format'];var opts={script:'',json:true,maxresults:10};wn.require('lib/js/legacy/widgets/autosuggest.js');var as=new AutoSuggest(d.widgets['To'],opts);as.custom_select=function(txt,sel){var r='';var tl=txt.split(',');for(var i=0;i<tl.length-1;i++)r=r+tl[i]+',';r=r+(r?' ':'')+sel;if(r[r.length-1]==NEWLINE)r=substr(0,r.length-1);return r;}
-var emailto=d.widgets['To']
-as.set_input_value=function(new_txt){if(emailto.value&&emailto.value.indexOf(',')!=-1){var txt=emailto.value.split(',');txt.splice(txt.length-1,1,new_txt);for(var i=0;i<txt.length-1;i++)txt[i]=strip(txt[i]);emailto.value=txt.join(', ');}else{emailto.value=new_txt;}}
-as.doAjaxRequest=function(txt){var pointer=as;var q='';var last_txt=txt.split(',');last_txt=last_txt[last_txt.length-1];var call_back=function(r,rt){as.aSug=[];if(!r.cl)return;for(var i=0;i<r.cl.length;i++){as.aSug.push({'id':r.cl[i],'value':r.cl[i],'info':''});}
-as.createList(as.aSug);}
-$c('webnotes.utils.email_lib.get_contact_list',{'select':_e.email_as_field,'from':_e.email_as_dt,'where':_e.email_as_in,'txt':(last_txt?strip(last_txt):'%')},call_back);return;}
-var sel;_e.dialog=d;}
+d.onhide=function(){}
+d.make_body([['Data','To','Example: abc@hotmail.com, xyz@yahoo.com'],['Select','Format'],['Data','Subject'],['Data','From','Optional'],['Check','Send With Attachments','Will send all attached documents (if any)'],['Text','Message'],['Button','Send',email_go]]);d.widgets['From'].value=(user_email?user_email:'');$td(d.rows['Format'].tab,0,1).cur_sel=d.widgets['Format'];function split(val){return val.split(/,\s*/);}
+function extractLast(term){return split(term).pop();}
+$(d.widgets['To']).bind("keydown",function(event){if(event.keyCode===$.ui.keyCode.TAB&&$(this).data("autocomplete").menu.active){event.preventDefault();}}).autocomplete({source:function(request,response){wn.call({method:'webnotes.utils.email_lib.get_contact_list',args:{'select':_e.email_as_field,'from':_e.email_as_dt,'where':_e.email_as_in,'txt':extractLast(request.term).value||'%'},callback:function(r){response($.ui.autocomplete.filter(r.cl||[],extractLast(request.term)));}});},focus:function(){return false;},select:function(event,ui){var terms=split(this.value);terms.pop();terms.push(ui.item.value);terms.push("");this.value=terms.join(", ");return false;}});_e.dialog=d;}
 /*
  *	lib/js/legacy/widgets/form/clientscriptAPI.js
  */
@@ -2105,8 +2090,8 @@
 /*
  *	lib/js/legacy/wn/widgets/form/attachments.js
  */
-wn.widgets.form.sidebar.Attachments=function(parent,sidebar,doctype,docname){var me=this;this.frm=sidebar.form;this.make=function(){if(this.wrapper)this.wrapper.innerHTML='';else this.wrapper=$a(parent,'div','sidebar-comment-wrapper');this.attach_wrapper=$a(this.wrapper,'div');if(this.frm.doc.__islocal){this.attach_wrapper.innerHTML='Attachments can be uploaded after saving'
-return;}
+wn.widgets.form.sidebar.Attachments=function(parent,sidebar,doctype,docname){var me=this;this.frm=sidebar.form;this.make=function(){if(this.wrapper)this.wrapper.innerHTML='';else this.wrapper=$a(parent,'div','sidebar-comment-wrapper');this.attach_wrapper=$a(this.wrapper,'div');if(this.frm.doc.__islocal){this.attach_wrapper.innerHTML='<div class="help">Attachments can be \
+    uploaded after saving</div>';return;}
 var n=this.frm.doc.file_list?this.frm.doc.file_list.split('\n').length:0;if(n<this.frm.meta.max_attachments||!this.frm.meta.max_attachments){this.btn=$btn($a(this.wrapper,'div','sidebar-comment-message'),'Add',function(){me.add_attachment()});}
 this.render();}
 this.render=function(){this.attach_wrapper.innerHTML=''
diff --git a/js/all-web.js b/js/all-web.js
index e1ccedd..53c433a 100644
--- a/js/all-web.js
+++ b/js/all-web.js
@@ -181,7 +181,7 @@
  *	lib/js/legacy/globals.js
  */
 wn.provide('wn.widgets.form');wn.provide('wn.widgets.report');wn.provide('wn.utils');wn.provide('wn.model');wn.provide('wn.profile');wn.provide('wn.session');wn.provide('_f');wn.provide('_p');wn.provide('_r');wn.provide('_c');wn.provide('_e');wn.provide('_startup_data')
-wn.settings.no_history=1;var NEWLINE='\n';var login_file='';var version='v170';var profile=null;var session={};var is_testing=false;var user=null;var user_defaults=null;var user_roles=null;var user_fullname=null;var user_email=null;var user_img={};var home_page=null;var hide_autosuggest=null;var page_body=null;var pscript={};var selector=null;var top_index=91;var _f={};var _p={};var _e={};var _r={};var FILTER_SEP='\1';var frms={};var cur_frm=null;var pscript={};var validated=true;var validation_message='';var tinymce_loaded=null;var cur_autosug=null;
+wn.settings.no_history=1;var NEWLINE='\n';var login_file='';var version='v170';var profile=null;var session={};var is_testing=false;var user=null;var user_defaults=null;var user_roles=null;var user_fullname=null;var user_email=null;var user_img={};var home_page=null;var page_body=null;var pscript={};var selector=null;var top_index=91;var _f={};var _p={};var _e={};var _r={};var FILTER_SEP='\1';var frms={};var cur_frm=null;var pscript={};var validated=true;var validation_message='';var tinymce_loaded=null;
 /*
  *	lib/js/legacy/utils/datatype.js
  */
@@ -387,7 +387,7 @@
 function $c_obj_csv(doclist,method,arg){var args={}
 args.cmd='runserverobj';args.as_csv=1;args.method=method;args.arg=arg;if(doclist.substr)
 args.doctype=doclist;else
-args.docs=compress_doclist(doclist);open_url_post(webnotes.request.url,args);}
+args.docs=compress_doclist(doclist);open_url_post(wn.request.url,args);}
 function open_url_post(URL,PARAMS,new_window){var temp=document.createElement("form");temp.action=URL;temp.method="POST";temp.style.display="none";if(new_window){temp.target='_blank';}
 for(var x in PARAMS){var opt=document.createElement("textarea");opt.name=x;opt.value=PARAMS[x];temp.appendChild(opt);}
 document.body.appendChild(temp);temp.submit();return temp;}
@@ -425,12 +425,12 @@
 var no_value_fields=['Section Break','Column Break','HTML','Table','FlexTable','Button','Image'];var codeid=0;var code_editors={};function Field(){this.with_label=1;}
 Field.prototype.make_body=function(){var ischk=(this.df.fieldtype=='Check'?1:0);if(this.parent)
 this.wrapper=$a(this.parent,(this.with_label?'div':'span'));else
-this.wrapper=document.createElement((this.with_label?'div':'span'));this.label_area=$a(this.wrapper,'div','',{margin:'8px 0px 2px 0px'});if(ischk&&!this.in_grid){this.input_area=$a(this.label_area,'span','',{marginRight:'4px'});this.disp_area=$a(this.label_area,'span','',{marginRight:'4px'});}
+this.wrapper=document.createElement((this.with_label?'div':'span'));this.label_area=$a(this.wrapper,'div','',{margin:'0px 0px 2px 0px'});if(ischk&&!this.in_grid){this.input_area=$a(this.label_area,'span','',{marginRight:'4px'});this.disp_area=$a(this.label_area,'span','',{marginRight:'4px'});}
 if(this.with_label){this.label_span=$a(this.label_area,'span','field_label')
 this.label_icon=$a(this.label_area,'img','',{margin:'-3px 4px -3px 4px'});$dh(this.label_icon);this.label_icon.src='lib/images/icons/error.gif';this.label_icon.title='Mandatory value needs to be entered';this.suggest_icon=$a(this.label_area,'img','',{margin:'-3px 4px -3px 0px'});$dh(this.suggest_icon);this.suggest_icon.src='lib/images/icons/bullet_arrow_down.png';this.suggest_icon.title='With suggestions';}else{this.label_span=$a(this.label_area,'span','',{marginRight:'4px'})
 $dh(this.label_area);}
 if(!this.input_area){this.input_area=$a(this.wrapper,(this.with_label?'div':'span'));this.disp_area=$a(this.wrapper,(this.with_label?'div':'span'));}
-if(this.in_grid){if(this.label_area)$dh(this.label_area);}else{this.input_area.className='input_area';$y(this.wrapper,{marginBottom:'4px'});this.set_description();}
+if(this.in_grid){if(this.label_area)$dh(this.label_area);}else{this.input_area.className='input_area';$y(this.wrapper,{marginBottom:'9px'});this.set_description();}
 if(this.onmake)this.onmake();}
 Field.prototype.set_max_width=function(){var no_max=['Code','Text Editor','Text','Table','HTML']
 if(this.wrapper&&this.layout_cell&&this.layout_cell.parentNode.cells&&this.layout_cell.parentNode.cells.length==1&&!in_list(no_max,this.df.fieldtype)){$y(this.wrapper,{paddingRight:'50%'});}}
@@ -525,7 +525,7 @@
 if(me.btn1)me.btn1.onclick=function(){if(me.txt.value&&me.df.options){loaddoc(me.df.options,me.txt.value);}}
 me.can_create=0;if((!me.not_in_form)&&in_list(profile.can_create,me.df.options)){me.can_create=1;me.btn2.onclick=function(){var on_save_callback=function(new_rec){if(new_rec){var d=_f.calling_doc_stack.pop();locals[d[0]][d[1]][me.df.fieldname]=new_rec;me.refresh();if(me.grid)me.grid.refresh();me.run_trigger();}}
 _f.calling_doc_stack.push([me.doctype,me.docname]);new_doc(me.df.options,me.on_new,1,on_save_callback,me.doctype,me.docname,me.frm.not_in_container);}}else{$dh(me.btn2);$y($td(me.tab,0,2),{width:'0px'});}}
-LinkField.prototype.set_input_value=function(val){var me=this;me.refresh_label_icon();if(me.not_in_form){return;}
+LinkField.prototype.set_input_value=function(val){var me=this;me.refresh_label_icon();if(me.not_in_form){$(this.txt).val(val);return;}
 if(cur_frm){if(val==locals[me.doctype][me.docname][me.df.fieldname]){me.set(val);me.run_trigger();return;}}
 me.set(val);if(_f.cur_grid_cell)
 _f.cur_grid_cell.grid.cell_deselect();if(!val){me.run_trigger();return;}
@@ -649,7 +649,7 @@
 this.set_postion=function(){var d=get_screen_dims();this.wrapper.style.left=((d.w-cint(this.wrapper.style.width))/2)+'px';this.wrapper.style.top=(get_scroll_top()+60)+'px';top_index++;$y(this.wrapper,{zIndex:top_index});}
 this.show=function(){if(this.display)return;this.set_postion()
 $ds(this.wrapper);freeze();this.display=true;cur_dialog=this;if(this.onshow)this.onshow();}
-this.hide=function(){if(this.onhide)this.onhide();unfreeze();$dh(this.wrapper);if(cur_autosug)cur_autosug.clearSuggestions();this.display=false;cur_dialog=null;}
+this.hide=function(){if(this.onhide)this.onhide();unfreeze();$dh(this.wrapper);this.display=false;cur_dialog=null;}
 this.no_cancel=function(){$dh(this.cancel_img);}
 if(opts)this.make();}
 wn.widgets.Dialog.prototype=new wn.widgets.FieldGroup();$(document).bind('keydown',function(e){if(cur_dialog&&!cur_dialog.no_cancel_flag&&e.which==27){cur_dialog.hide();}});
@@ -678,7 +678,7 @@
  *	lib/js/wn/ui/listing.js
  */
 wn.provide('wn.ui');wn.ui.Listing=Class.extend({init:function(opts){this.opts=opts||{};this.page_length=20;this.start=0;this.data=[];if(opts){this.make();}},prepare_opts:function(){if(this.opts.new_doctype)
-this.opts.new_doctype=get_doctype_label(this.opts.new_doctype);},make:function(opts){if(opts){this.opts=opts;}
+this.opts.new_doctype=get_doctype_label(this.opts.new_doctype);if(!this.opts.no_result_message){this.opts.no_result_message='Nothing to show'}},make:function(opts){if(opts){this.opts=opts;}
 $.extend(this,this.opts);this.prepare_opts();$(this.parent).html(repl('\
    <div class="wnlist">\
     <div class="btn-group hide select-view" style="float: right;">\
@@ -689,7 +689,7 @@
     </div>\
     \
     <h3 class="title hide">%(title)s</h3>\
-    <div style="height: 30px;">\
+    <div style="height: 37px;" class="list-toolbar-wrapper">\
      <div class="list-toolbar" style="float: left;">\
       <a class="btn btn-small btn-refresh btn-info">\
        <i class="icon-refresh icon-white"></i> Refresh</a>\
@@ -702,7 +702,6 @@
       class="img-load"/>\
     </div>\
     \
-    <div style="clear: both; height: 11px;"></div>\
     <div class="list-filters hide">\
      <div class="show_filters well">\
       <div class="filter_area"></div>\
@@ -731,7 +730,8 @@
 if(!me.show_filters){this.$w.find('.btn-filter').toggle(false).attr('hidden','hidden');}
 if(this.hide_refresh||this.no_refresh){this.$w.find('.btn-refresh').toggle(false).attr('hidden','hidden');}
 if(this.show_grid){this.$w.find('.select-view').toggle(true);}
-if(this.$w.find('.list-toolbar a[hidden!="hidden"]').length>1){this.$w.find('.list-toolbar').addClass('btn-group')}},make_filters:function(){this.filter_list=new wn.ui.FilterList({listobj:this,$parent:this.$w.find('.list-filters').toggle(true),doctype:this.doctype,filter_fields:this.filter_fields});},clear:function(){this.data=[];this.$w.find('.result-list').empty();this.$w.find('.result').toggle(true);this.$w.find('.no-result').toggle(false);this.start=0;},run:function(){var me=this;var a0=arguments[0];var a1=arguments[1];if(a0&&typeof a0=='function')
+if(this.$w.find('.list-toolbar a[hidden!="hidden"]').length>1){this.$w.find('.list-toolbar').addClass('btn-group')}
+if(this.$w.find('.list-toolbar a[hidden!="hidden"]').length==0){this.$w.find('.list-toolbar-wrapper').toggle(false);}},make_filters:function(){this.filter_list=new wn.ui.FilterList({listobj:this,$parent:this.$w.find('.list-filters').toggle(true),doctype:this.doctype,filter_fields:this.filter_fields});},clear:function(){this.data=[];this.$w.find('.result-list').empty();this.$w.find('.result').toggle(true);this.$w.find('.no-result').toggle(false);this.start=0;},run:function(){var me=this;var a0=arguments[0];var a1=arguments[1];if(a0&&typeof a0=='function')
 this.onrun=a0;if(a0&&a0.callback)
 this.onrun=a0.callback;if(!a1&&!(a0&&a0.append))
 this.start=0;me.$w.find('.img-load').toggle(true);wn.call({method:this.opts.method||'webnotes.widgets.query_builder.runquery',args:this.get_call_args(),callback:function(r){me.$w.find('.img-load').toggle(false);me.render_results(r)},no_spinner:this.opts.no_loading,btn:this.run_btn});},get_call_args:function(){if(!this.method){this.query=this.get_query?this.get_query():this.query;this.add_limits();var args={query_max:this.query_max,as_dict:1}
@@ -740,7 +740,9 @@
 $.extend(args,this.args)
 if(this.get_args){$.extend(args,this.get_args());}
 return args;},render_results:function(r){if(this.start==0)this.clear();this.$w.find('.btn-more').toggle(false);if(r.message)r.values=r.message;if(r.values&&r.values.length){this.data=this.data.concat(r.values);this.render_list(r.values);if(this.show_grid){this.render_grid();}}else{if(this.start==0){this.$w.find('.result').toggle(false);this.$w.find('.no-result').toggle(true);}}
-if(this.onrun)this.onrun();if(this.callback)this.callback(r);},render_grid:function(){$.each(this.columns,function(i,c){if(!c.id)c.id=c.field;})
+if(this.onrun)this.onrun();if(this.callback)this.callback(r);},render_grid:function(){if(this.columns[0].field!='_idx'){this.columns=[{field:'_idx',name:'Sr.',width:40}].concat(this.columns);}
+$.each(this.columns,function(i,c){if(!c.id)c.id=c.field;})
+$.each(this.data,function(i,v){v._idx=i+1;})
 wn.require('lib/js/lib/slickgrid/slick.grid.css');wn.require('lib/js/lib/slickgrid/slick-default-theme.css');wn.require('lib/js/lib/slickgrid/jquery.event.drag.min.js');wn.require('lib/js/lib/slickgrid/slick.core.js');wn.require('lib/js/lib/slickgrid/slick.grid.js');var options={enableCellNavigation:true,enableColumnReorder:false};grid=new Slick.Grid(this.$w.find('.result-grid').css('border','1px solid grey').css('height','500px').get(0),this.data,this.columns,options);},render_list:function(values){var m=Math.min(values.length,this.page_length);for(var i=0;i<m;i++){this.render_row(this.add_row(),values[i],this,i);}
 this.start+=m;if(values.length>=this.page_length)
 this.$w.find('.btn-more').toggle(true);},add_row:function(){return this.$w.find('.result-list').append('<div class="list-row">').find('.list-row:last').get(0);},refresh:function(){this.run();},add_limits:function(){this.query+=' LIMIT '+this.start+','+(this.page_length+1);}});wn.ui.FilterList=Class.extend({init:function(opts){$.extend(this,opts);this.filters=[];this.$w=this.$parent;this.set_events();},set_events:function(){var me=this;this.listobj.$w.find('.btn-filter').bind('click',function(){me.$w.find('.show_filters').slideToggle();if(!me.filters.length)
@@ -788,7 +790,7 @@
 LayoutRow.prototype.show=function(){$ds(this.wrapper);}
 LayoutRow.prototype.addCell=function(wid){var lc=new LayoutCell(this.layout,this,wid);this.mycells[this.mycells.length]=lc;return lc;}
 function LayoutCell(layout,layoutRow,width){if(width){var w=width+'';if(w.substr(w.length-2,2)!='px'){if(w.substr(w.length-1,1)!="%"){width=width+'%'};}}
-this.width=width;this.layout=layout;var cidx=layoutRow.row.cells.length;this.cell=layoutRow.row.insertCell(cidx);this.cell.style.verticalAlign='top';this.set_width(layoutRow.row,width);var h=$a(this.cell,'div','',{padding:(layout.with_border?'0px 8px':'0px')});this.wrapper=$a(this.cell,'div','',{padding:(layout.with_border?'8px':'8px 0px')});layout.cur_cell=this.wrapper;layout.cur_cell.header=h;}
+this.width=width;this.layout=layout;var cidx=layoutRow.row.cells.length;this.cell=layoutRow.row.insertCell(cidx);this.cell.style.verticalAlign='top';this.set_width(layoutRow.row,width);var h=$a(this.cell,'div','',{padding:(layout.with_border?'0px 8px':'0px')});this.wrapper=$a(this.cell,'div','',{padding:(layout.with_border?'8px':'0px')});layout.cur_cell=this.wrapper;layout.cur_cell.header=h;}
 LayoutCell.prototype.set_width=function(row,width){var w=100;var n_cells=row.cells.length;var cells_with_no_width=n_cells;if(width){$y(row.cells[n_cells-1],{width:cint(width)+'%'})}else{row.cells[n_cells-1].estimated_width=1;}
 for(var i=0;i<n_cells;i++){if(!row.cells[i].estimated_width){w=w-cint(row.cells[i].style.width);cells_with_no_width--;}}
 for(var i=0;i<n_cells;i++){if(row.cells[i].estimated_width)
@@ -927,14 +929,14 @@
  *	lib/js/legacy/webpage/uploader.js
  */
 var uploaders={};var upload_frame_count=0;Uploader=function(parent,args,callback){var id='frame'+upload_frame_count;upload_frame_count++;this.callback=callback;var div=$a(parent,'div');div.innerHTML='<iframe id="'+id+'" name="'+id+'" src="blank.html" \
-  style="width:0px; height:0px; border:0px"></iframe>';var div=$a(parent,'div');div.innerHTML='<form method="POST" enctype="multipart/form-data" action="'+webnotes.request.url+'" target="'+id+'"></form>';var ul_form=div.childNodes[0];var f_list=[];var inp_fdata=$a_input($a(ul_form,'span'),'file',{name:'filedata'},{marginLeft:'7px'});if(!('cmd'in args)){var inp=$a_input($a(ul_form,'span'),'hidden',{name:'cmd'});inp.value='uploadfile';}
+  style="width:0px; height:0px; border:0px"></iframe>';var div=$a(parent,'div');div.innerHTML='<form method="POST" enctype="multipart/form-data" action="'+wn.request.url+'" target="'+id+'"></form>';var ul_form=div.childNodes[0];var f_list=[];var inp_fdata=$a_input($a(ul_form,'span'),'file',{name:'filedata'},{marginLeft:'7px'});if(!('cmd'in args)){var inp=$a_input($a(ul_form,'span'),'hidden',{name:'cmd'});inp.value='uploadfile';}
 var inp=$a_input($a(ul_form,'span'),'hidden',{name:'uploader_id'});inp.value=id;var inp=$a_input($a(ul_form,'span'),'submit',null,{marginLeft:'7px'});inp.value='Upload';$y(inp,{width:'80px'});for(var key in args){var inp=$a_input($a(ul_form,'span'),'hidden',{name:key});inp.value=args[key];}
 uploaders[id]=this;}
 function upload_callback(id,fid){uploaders[id].callback(fid);}
 /*
  *	lib/js/legacy/webpage/page.js
  */
-var stylesheets=[];function Page(page_name,content){var me=this;this.name=page_name;this.trigger=function(event){try{if(pscript[event+'_'+this.name])
+function Page(page_name,content){var me=this;this.name=page_name;this.trigger=function(event){try{if(pscript[event+'_'+this.name])
 pscript[event+'_'+this.name](me.wrapper);if(me.wrapper[event]){me.wrapper[event](me.wrapper);}}catch(e){console.log(e);}}
 this.page_show=function(){set_title(me.doc.title?me.doc.title:me.name);if(!me.onload_complete){me.trigger('onload');me.onload_complete=true;}
 me.trigger('onshow');cur_frm=null;}
@@ -943,11 +945,10 @@
 this.wrapper.innerHTML=content;return this;}
 function render_page(page_name,menuitem){if(!page_name)return;if((!locals['Page'])||(!locals['Page'][page_name])){loadpage('_home');return;}
 var pdoc=locals['Page'][page_name];if(pdoc.style)set_style(pdoc.style)
-if(pdoc.stylesheet){set_style(locals.Stylesheet[pdoc.stylesheet].stylesheet);stylesheets.push(pdoc.stylesheet);}
 var p=new Page(page_name,pdoc._Page__content?pdoc._Page__content:pdoc.content);var script=pdoc.__script?pdoc.__script:pdoc.script;p.doc=pdoc;if(script){eval(script);}
 page_body.change_to(page_name);return p;}
 function refresh_page(page_name){var fn=function(r,rt){render_page(page_name)}
-$c('webnotes.widgets.page.getpage',{'name':page_name,stylesheets:JSON.stringify(stylesheets)},fn);}
+$c('webnotes.widgets.page.getpage',{'name':page_name},fn);}
 /*
  *	lib/js/legacy/wn/page_layout.js
  */
diff --git a/version.num b/version.num
index 36699e7..e57d8df 100644
--- a/version.num
+++ b/version.num
@@ -1 +1 @@
-933
\ No newline at end of file
+965
\ No newline at end of file