fix: Custom dashboard sections
This commit is contained in:
		
							parent
							
								
									2b405b9bb3
								
							
						
					
					
						commit
						67095d239f
					
				| @ -101,7 +101,8 @@ frappe.ui.form.on('Opening Invoice Creation Tool', { | |||||||
| 				frappe.render_template('opening_invoice_creation_tool_dashboard', { | 				frappe.render_template('opening_invoice_creation_tool_dashboard', { | ||||||
| 					data: opening_invoices_summary, | 					data: opening_invoices_summary, | ||||||
| 					max_count: max_count | 					max_count: max_count | ||||||
| 				}) | 				}), | ||||||
|  | 				__("Opening Invoices Summary") | ||||||
| 			); | 			); | ||||||
| 
 | 
 | ||||||
| 			section.on('click', '.invoice-link', function() { | 			section.on('click', '.invoice-link', function() { | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| <h5 style="margin-top: 0px;">{{ __("Opening Invoices Summary") }}</h5> |  | ||||||
| {% $.each(data, (company, summary) => { %} | {% $.each(data, (company, summary) => { %} | ||||||
| <h6 style="margin: 15px 0px -10px 0px;"><a class="company-link"> {{ company }}</a></h6> | <h6 style="margin: 15px 0px -10px 0px;"><a class="company-link"> {{ company }}</a></h6> | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -40,8 +40,7 @@ frappe.ui.form.on('Asset Maintenance', { | |||||||
| 					if(!r.message) { | 					if(!r.message) { | ||||||
| 						return; | 						return; | ||||||
| 					} | 					} | ||||||
| 					var section = frm.dashboard.add_section(`<h5 style="margin-top: 0px;">
 | 					const section = frm.dashboard.add_section('', __("Maintenance Log")); | ||||||
| 						${ __("Maintenance Log") }</a></h5>`); |  | ||||||
| 					var rows = $('<div></div>').appendTo(section); | 					var rows = $('<div></div>').appendTo(section); | ||||||
| 					// show
 | 					// show
 | ||||||
| 					(r.message || []).forEach(function(d) { | 					(r.message || []).forEach(function(d) { | ||||||
|  | |||||||
| @ -75,7 +75,8 @@ frappe.ui.form.on("Leave Application", { | |||||||
| 			frm.dashboard.add_section( | 			frm.dashboard.add_section( | ||||||
| 				frappe.render_template('leave_application_dashboard', { | 				frappe.render_template('leave_application_dashboard', { | ||||||
| 					data: leave_details | 					data: leave_details | ||||||
| 				}) | 				}), | ||||||
|  | 				__("Allocated Leaves") | ||||||
| 			); | 			); | ||||||
| 			frm.dashboard.show(); | 			frm.dashboard.show(); | ||||||
| 			let allowed_leave_types =  Object.keys(leave_details); | 			let allowed_leave_types =  Object.keys(leave_details); | ||||||
|  | |||||||
| @ -1,6 +1,5 @@ | |||||||
| 
 | 
 | ||||||
| {% if not jQuery.isEmptyObject(data) %} | {% if not jQuery.isEmptyObject(data) %} | ||||||
| <h5 style="margin-top: 20px;"> {{ __("Allocated Leaves") }} </h5> |  | ||||||
| <table class="table table-bordered small"> | <table class="table table-bordered small"> | ||||||
| 	<thead> | 	<thead> | ||||||
| 		<tr> | 		<tr> | ||||||
|  | |||||||
| @ -47,8 +47,7 @@ frappe.ui.form.on('Batch', { | |||||||
| 						return; | 						return; | ||||||
| 					} | 					} | ||||||
| 
 | 
 | ||||||
| 					var section = frm.dashboard.add_section(`<h5 style="margin-top: 0px;">
 | 					const section = frm.dashboard.add_section('', __("Stock Levels")); | ||||||
| 						${ __("Stock Levels") }</a></h5>`); |  | ||||||
| 
 | 
 | ||||||
| 					// sort by qty
 | 					// sort by qty
 | ||||||
| 					r.message.sort(function(a, b) { a.qty > b.qty ? 1 : -1 }); | 					r.message.sort(function(a, b) { a.qty > b.qty ? 1 : -1 }); | ||||||
|  | |||||||
| @ -380,8 +380,7 @@ $.extend(erpnext.item, { | |||||||
| 		// Show Stock Levels only if is_stock_item
 | 		// Show Stock Levels only if is_stock_item
 | ||||||
| 		if (frm.doc.is_stock_item) { | 		if (frm.doc.is_stock_item) { | ||||||
| 			frappe.require('assets/js/item-dashboard.min.js', function() { | 			frappe.require('assets/js/item-dashboard.min.js', function() { | ||||||
| 				var section = frm.dashboard.add_section('<h5 style="margin-top: 0px;">\ | 				const section = frm.dashboard.add_section('', __("Stock Levels")); | ||||||
| 					<a href="#stock-balance">' + __("Stock Levels") + '</a></h5>'); |  | ||||||
| 				erpnext.item.item_dashboard = new erpnext.stock.ItemDashboard({ | 				erpnext.item.item_dashboard = new erpnext.stock.ItemDashboard({ | ||||||
| 					parent: section, | 					parent: section, | ||||||
| 					item_code: frm.doc.name | 					item_code: frm.doc.name | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user