[cleanup] rename "links" to "dashboard"
This commit is contained in:
parent
2a1e3bb31b
commit
964ad0fcae
@ -29,8 +29,6 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
|
||||
cur_frm.msgbox.hide();
|
||||
}
|
||||
|
||||
cur_frm.dashboard.reset();
|
||||
|
||||
this.frm.toggle_reqd("due_date", !this.frm.doc.is_return);
|
||||
|
||||
this.show_general_ledger();
|
||||
@ -68,11 +66,11 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
|
||||
if(doc.outstanding_amount!=0 && !cint(doc.is_return)) {
|
||||
cur_frm.add_custom_button(__('Payment'), this.make_payment_entry, __("Make"));
|
||||
}
|
||||
|
||||
|
||||
if(doc.outstanding_amount>0 && !cint(doc.is_return)) {
|
||||
cur_frm.add_custom_button(__('Payment Request'), this.make_payment_request, __("Make"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@ erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend(
|
||||
refresh: function(doc, cdt, cdn) {
|
||||
var me = this;
|
||||
this._super();
|
||||
// this.frm.dashboard.reset();
|
||||
var allow_receipt = false;
|
||||
var is_drop_ship = false;
|
||||
|
||||
|
@ -39,7 +39,6 @@ frappe.ui.form.on("Request for Quotation",{
|
||||
|
||||
refresh: function(frm, cdt, cdn) {
|
||||
if (frm.doc.docstatus === 1) {
|
||||
frm.dashboard.show_dashboard();
|
||||
frm.add_custom_button(__("Make"),
|
||||
function(){ frm.trigger("make_suppplier_quotation") }, __("Supplier Quotation"));
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
from frappe import _
|
||||
|
||||
links = {
|
||||
data = {
|
||||
'docstatus': 1,
|
||||
'fieldname': 'request_for_quotation',
|
||||
# 'non_standard_fieldnames': {
|
||||
# 'Purchase Order': 'prevdoc_detail_docname',
|
@ -6,10 +6,6 @@ frappe.ui.form.on("Supplier", {
|
||||
frappe.setup_language_field(frm);
|
||||
},
|
||||
refresh: function(frm) {
|
||||
frm.dashboard.show_heatmap = true;
|
||||
frm.dashboard.heatmap_message = __('This is based on transactions against this Supplier. See timeline below for details');
|
||||
frm.dashboard.show_dashboard();
|
||||
|
||||
if(frappe.defaults.get_default("supp_master_name")!="Naming Series") {
|
||||
frm.toggle_display("naming_series", false);
|
||||
} else {
|
||||
|
@ -1,6 +1,8 @@
|
||||
from frappe import _
|
||||
|
||||
links = {
|
||||
data = {
|
||||
'heatmap': True,
|
||||
'heatmap_message': _('This is based on transactions against this Supplier. See timeline below for details'),
|
||||
'fieldname': 'supplier',
|
||||
'transactions': [
|
||||
{
|
11
erpnext/crm/doctype/opportunity/opportunity_dashboard.py
Normal file
11
erpnext/crm/doctype/opportunity/opportunity_dashboard.py
Normal file
@ -0,0 +1,11 @@
|
||||
from frappe import _
|
||||
|
||||
data = {
|
||||
'fieldname': 'prevdoc_docname',
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Related Documents'),
|
||||
'items': ['Quotation']
|
||||
},
|
||||
]
|
||||
}
|
@ -24,9 +24,6 @@ erpnext.hr.EmployeeController = frappe.ui.form.Controller.extend({
|
||||
refresh: function() {
|
||||
var me = this;
|
||||
erpnext.toggle_naming_series();
|
||||
this.frm.dashboard.show_heatmap = true;
|
||||
this.frm.dashboard.heatmap_message = __('This is based on the attendance of this Employee');
|
||||
this.frm.dashboard.show_dashboard();
|
||||
},
|
||||
|
||||
date_of_birth: function() {
|
||||
|
@ -1,6 +1,8 @@
|
||||
from frappe import _
|
||||
|
||||
links = {
|
||||
data = {
|
||||
'heatmap': True,
|
||||
'heatmap_message': _('This is based on the attendance of this Employee'),
|
||||
'fieldname': 'employee',
|
||||
'transactions': [
|
||||
{
|
@ -66,10 +66,6 @@ frappe.ui.form.on("Project", {
|
||||
});
|
||||
},
|
||||
show_dashboard: function(frm) {
|
||||
frm.dashboard.show_heatmap = true;
|
||||
frm.dashboard.heatmap_message = __('This is based on the Time Sheet created against this project');
|
||||
frm.dashboard.show_dashboard();
|
||||
|
||||
if(frm.doc.__onload.activity_summary.length) {
|
||||
var hours = $.map(frm.doc.__onload.activity_summary, function(d) { return d.total_hours });
|
||||
var max_count = Math.max.apply(null, hours);
|
||||
|
@ -1,6 +1,8 @@
|
||||
from frappe import _
|
||||
|
||||
links = {
|
||||
data = {
|
||||
'heatmap': True,
|
||||
'heatmap_message': _('This is based on the Time Sheets created against this project'),
|
||||
'fieldname': 'project',
|
||||
'transactions': [
|
||||
{
|
@ -6,10 +6,6 @@ frappe.ui.form.on("Customer", {
|
||||
frappe.setup_language_field(frm);
|
||||
},
|
||||
refresh: function(frm) {
|
||||
frm.dashboard.show_heatmap = true;
|
||||
frm.dashboard.heatmap_message = __('This is based on transactions against this Customer. See timeline below for details');
|
||||
frm.dashboard.show_dashboard();
|
||||
|
||||
if(frappe.defaults.get_default("cust_master_name")!="Naming Series") {
|
||||
frm.toggle_display("naming_series", false);
|
||||
} else {
|
||||
@ -45,7 +41,7 @@ cur_frm.cscript.load_defaults = function(doc, dt, dn) {
|
||||
if(fields_to_refresh) { refresh_many(fields_to_refresh); }
|
||||
}
|
||||
|
||||
cur_frm.add_fetch('lead_name', 'company_name', 'customer_name');
|
||||
cur_frm.add_fetch('lead_name', ('company_name', 'customer_name');
|
||||
cur_frm.add_fetch('default_sales_partner','commission_rate','default_commission_rate');
|
||||
|
||||
cur_frm.fields_dict['customer_group'].get_query = function(doc, dt, dn) {
|
||||
|
@ -1,6 +1,8 @@
|
||||
from frappe import _
|
||||
|
||||
links = {
|
||||
data = {
|
||||
'heatmap': True,
|
||||
'heatmap_message': _('This is based on transactions against this Customer. See timeline below for details'),
|
||||
'fieldname': 'customer',
|
||||
'transactions': [
|
||||
{
|
@ -18,10 +18,9 @@ frappe.ui.form.on("Sales Order", {
|
||||
erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend({
|
||||
refresh: function(doc, dt, dn) {
|
||||
this._super();
|
||||
this.frm.dashboard.reset();
|
||||
var allow_purchase = false;
|
||||
var allow_delivery = false;
|
||||
|
||||
|
||||
if(doc.docstatus==1) {
|
||||
if(doc.status != 'Closed') {
|
||||
|
||||
@ -80,7 +79,7 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend(
|
||||
}
|
||||
|
||||
// maintenance
|
||||
if(flt(doc.per_delivered, 2) < 100 &&
|
||||
if(flt(doc.per_delivered, 2) < 100 &&
|
||||
["Sales", "Shopping Cart"].indexOf(doc.order_type)===-1) {
|
||||
cur_frm.add_custom_button(__('Maintenance Visit'), this.make_maintenance_visit, __("Make"));
|
||||
cur_frm.add_custom_button(__('Maintenance Schedule'), this.make_maintenance_schedule, __("Make"));
|
||||
|
@ -172,19 +172,19 @@ $.extend(erpnext.item, {
|
||||
frm.fields_dict.supplier_items.grid.get_field("supplier").get_query = function(doc, cdt, cdn) {
|
||||
return { query: "erpnext.controllers.queries.supplier_query" }
|
||||
}
|
||||
|
||||
|
||||
frm.fields_dict['default_warehouse'].get_query = function(doc) {
|
||||
return {
|
||||
filters: { "is_group": 0 }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
frm.fields_dict.reorder_levels.grid.get_field("warehouse_group").get_query = function(doc, cdt, cdn) {
|
||||
return {
|
||||
filters: { "is_group": 1 }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
frm.fields_dict.reorder_levels.grid.get_field("warehouse").get_query = function(doc, cdt, cdn) {
|
||||
var d = locals[cdt][cdn];
|
||||
return {
|
||||
@ -198,15 +198,9 @@ $.extend(erpnext.item, {
|
||||
},
|
||||
|
||||
make_dashboard: function(frm) {
|
||||
frm.dashboard.reset();
|
||||
if(frm.doc.__islocal)
|
||||
return;
|
||||
|
||||
frm.dashboard.show_heatmap = frm.doc.is_stock_item;
|
||||
frm.dashboard.heatmap_message = __('This is based on stock movement. See {0} for details',
|
||||
['<a href="#query-report/Stock Ledger">' + __('Stock Ledger') + '</a>']);
|
||||
frm.dashboard.show_dashboard();
|
||||
|
||||
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>');
|
||||
erpnext.item.item_dashboard = new erpnext.stock.ItemDashboard({
|
||||
|
@ -1,6 +1,9 @@
|
||||
from frappe import _
|
||||
|
||||
links = {
|
||||
data = {
|
||||
'heatmap': True,
|
||||
'heatmap_message': _('This is based on stock movement. See {0} for details')\
|
||||
.format('<a href="#query-report/Stock Ledger">' + _('Stock Ledger') + '</a>'),
|
||||
'fieldname': 'item_code',
|
||||
'non_standard_fieldnames': {
|
||||
'Production Order': 'production_item',
|
@ -49,9 +49,6 @@ erpnext.buying.MaterialRequestController = erpnext.buying.BuyingController.exten
|
||||
}
|
||||
|
||||
if(doc.docstatus == 1 && doc.status != 'Stopped') {
|
||||
|
||||
// this.frm.dashboard.show_dashboard();
|
||||
|
||||
if(flt(doc.per_ordered, 2) < 100) {
|
||||
// make
|
||||
if(doc.material_request_type === "Material Transfer" && doc.status === "Submitted")
|
||||
|
@ -1,6 +1,7 @@
|
||||
from frappe import _
|
||||
|
||||
links = {
|
||||
data = {
|
||||
'docstatus': 1,
|
||||
'fieldname': 'material_request',
|
||||
'non_standard_fieldnames': {
|
||||
'Purchase Order': 'prevdoc_detail_docname',
|
Loading…
x
Reference in New Issue
Block a user