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