[design] form toolbar
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
index 2061fb1..c059702 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
@@ -73,12 +73,12 @@
});
if(!from_delivery_note) {
- cur_frm.appframe.add_primary_action(__('Make Delivery'), cur_frm.cscript['Make Delivery Note'], "icon-truck")
+ cur_frm.page.add_menu_item(__('Make Delivery'), cur_frm.cscript['Make Delivery Note'], "icon-truck")
}
}
if(doc.outstanding_amount!=0) {
- cur_frm.appframe.add_primary_action(__('Make Payment Entry'), cur_frm.cscript.make_bank_voucher, "icon-money");
+ cur_frm.page.add_menu_item(__('Make Payment Entry'), cur_frm.cscript.make_bank_voucher, "icon-money");
}
}
@@ -90,7 +90,7 @@
},
sales_order_btn: function() {
- this.$sales_order_btn = cur_frm.appframe.add_primary_action(__('From Sales Order'),
+ this.$sales_order_btn = cur_frm.page.add_menu_item(__('From Sales Order'),
function() {
frappe.model.map_current_doc({
method: "erpnext.selling.doctype.sales_order.sales_order.make_sales_invoice",
@@ -107,7 +107,7 @@
},
delivery_note_btn: function() {
- this.$delivery_note_btn = cur_frm.appframe.add_primary_action(__('From Delivery Note'),
+ this.$delivery_note_btn = cur_frm.page.add_menu_item(__('From Delivery Note'),
function() {
frappe.model.map_current_doc({
method: "erpnext.stock.doctype.delivery_note.delivery_note.make_sales_invoice",
diff --git a/erpnext/accounts/page/accounts_browser/accounts_browser.js b/erpnext/accounts/page/accounts_browser/accounts_browser.js
index dc0dd7a..cfdc2b4 100644
--- a/erpnext/accounts/page/accounts_browser/accounts_browser.js
+++ b/erpnext/accounts/page/accounts_browser/accounts_browser.js
@@ -41,16 +41,16 @@
'<p>'+__('Please setup your chart of accounts before you start Accounting Entries')+'</p></div>').appendTo(main);
if (frappe.boot.user.can_create.indexOf("Company") !== -1) {
- wrapper.appframe.add_button(__('New Company'), function() { newdoc('Company'); },
+ wrapper.page.add_button(__('New Company'), function() { newdoc('Company'); },
'icon-plus');
}
- wrapper.appframe.set_title_right(__('Refresh'), function() {
+ wrapper.page.set_primary_action(__('Refresh'), function() {
wrapper.$company_select.change();
});
// company-select
- wrapper.$company_select = wrapper.appframe.add_select("Company", [])
+ wrapper.$company_select = wrapper.page.add_select("Company", [])
.change(function() {
var ctype = frappe.get_route()[1] || 'Account';
erpnext.account_chart = new erpnext.AccountsChart(ctype, $(this).val(),
@@ -73,9 +73,9 @@
pscript.set_title = function(wrapper, ctype, val) {
if(val) {
- wrapper.appframe.set_title('Chart of '+ctype+'s' + " - " + cstr(val));
+ wrapper.page.set_title('Chart of '+ctype+'s' + " - " + cstr(val));
} else {
- wrapper.appframe.set_title('Chart of '+ctype+'s');
+ wrapper.page.set_title('Chart of '+ctype+'s');
}
}
diff --git a/erpnext/buying/page/purchase_analytics/purchase_analytics.js b/erpnext/buying/page/purchase_analytics/purchase_analytics.js
index e1d6294..2cc5b7a 100644
--- a/erpnext/buying/page/purchase_analytics/purchase_analytics.js
+++ b/erpnext/buying/page/purchase_analytics/purchase_analytics.js
@@ -21,7 +21,7 @@
title: __("Purchase Analytics"),
page: wrapper,
parent: $(wrapper).find('.layout-main'),
- appframe: wrapper.appframe,
+ page: wrapper.page,
doctypes: ["Item", "Item Group", "Supplier", "Supplier Type", "Company", "Fiscal Year",
"Purchase Invoice", "Purchase Invoice Item",
"Purchase Order", "Purchase Order Item[Purchase Analytics]",
diff --git a/erpnext/projects/doctype/time_log/time_log_list.js b/erpnext/projects/doctype/time_log/time_log_list.js
index 6115607..e9a7c76 100644
--- a/erpnext/projects/doctype/time_log/time_log_list.js
+++ b/erpnext/projects/doctype/time_log/time_log_list.js
@@ -6,7 +6,7 @@
add_fields: ["status", "billable", "activity_type", "task", "project", "hours", "time_log_for"],
selectable: true,
onload: function(me) {
- me.appframe.add_primary_action(__("Make Time Log Batch"), function() {
+ me.page.add_menu_item(__("Make Time Log Batch"), function() {
var selected = me.get_checked_items() || [];
if(!selected.length) {
diff --git a/erpnext/public/js/account_tree_grid.js b/erpnext/public/js/account_tree_grid.js
index 87fb7a9..4bc93ea 100644
--- a/erpnext/public/js/account_tree_grid.js
+++ b/erpnext/public/js/account_tree_grid.js
@@ -20,7 +20,7 @@
title: title,
page: wrapper,
parent: $(wrapper).find('.layout-main'),
- appframe: wrapper.appframe,
+ page: wrapper.page,
doctypes: ["Company", "Fiscal Year", "Account", "GL Entry", "Cost Center"],
tree_grid: {
show: true,
diff --git a/erpnext/public/js/stock_analytics.js b/erpnext/public/js/stock_analytics.js
index 091836f..d32afeb 100644
--- a/erpnext/public/js/stock_analytics.js
+++ b/erpnext/public/js/stock_analytics.js
@@ -9,7 +9,7 @@
title: __("Stock Analytics"),
page: wrapper,
parent: $(wrapper).find('.layout-main'),
- appframe: wrapper.appframe,
+ page: wrapper.page,
doctypes: ["Item", "Item Group", "Warehouse", "Stock Ledger Entry", "Brand",
"Fiscal Year", "Serial No"],
tree_grid: {
diff --git a/erpnext/public/js/transaction.js b/erpnext/public/js/transaction.js
index 5bbfae4..ab1f7d2 100644
--- a/erpnext/public/js/transaction.js
+++ b/erpnext/public/js/transaction.js
@@ -82,9 +82,9 @@
this.$pos_btn && this.$pos_btn.remove();
- this.$pos_btn = this.frm.appframe.add_primary_action(btn_label, function() {
+ this.$pos_btn = this.frm.page.add_menu_item(btn_label, function() {
me.toggle_pos();
- }, icon, "btn-default");
+ });
} else {
// hack: will avoid calling refresh from refresh
setTimeout(function() { me.toggle_pos(false); }, 100);
@@ -105,12 +105,12 @@
// make pos
if(!this.frm.pos) {
- var wrapper = this.frm.appframe.add_view("pos", "<div>");
+ var wrapper = this.frm.page.add_view("pos", "<div>");
this.frm.pos = new erpnext.POS(wrapper, this.frm);
}
// toggle view
- this.frm.appframe.set_view(this.pos_active ? "main" : "pos");
+ this.frm.page.set_view(this.pos_active ? "main" : "pos");
this.pos_active = !this.pos_active;
// refresh
diff --git a/erpnext/selling/page/sales_analytics/sales_analytics.js b/erpnext/selling/page/sales_analytics/sales_analytics.js
index 7586353..8e5ca96 100644
--- a/erpnext/selling/page/sales_analytics/sales_analytics.js
+++ b/erpnext/selling/page/sales_analytics/sales_analytics.js
@@ -20,7 +20,7 @@
title: __("Sales Analytics"),
page: wrapper,
parent: $(wrapper).find('.layout-main'),
- appframe: wrapper.appframe,
+ page: wrapper.page,
doctypes: ["Item", "Item Group", "Customer", "Customer Group", "Company", "Territory",
"Fiscal Year", "Sales Invoice", "Sales Invoice Item",
"Sales Order", "Sales Order Item[Sales Analytics]",
diff --git a/erpnext/selling/page/sales_browser/sales_browser.js b/erpnext/selling/page/sales_browser/sales_browser.js
index fcbd71c..3f8f6cb 100644
--- a/erpnext/selling/page/sales_browser/sales_browser.js
+++ b/erpnext/selling/page/sales_browser/sales_browser.js
@@ -8,7 +8,7 @@
frappe.add_breadcrumbs("Selling")
- wrapper.appframe.set_title_right(__('Refresh'), function() {
+ wrapper.page.set_primary_action(__('Refresh'), function() {
wrapper.make_tree();
});
@@ -44,7 +44,7 @@
// set route
var ctype = frappe.get_route()[1] || 'Territory';
- wrapper.appframe.set_title(__('{0} Tree',[__(ctype)]));
+ wrapper.page.set_title(__('{0} Tree',[__(ctype)]));
if(erpnext.sales_chart && erpnext.sales_chart.ctype != ctype) {
wrapper.make_tree();
diff --git a/erpnext/selling/page/sales_funnel/sales_funnel.js b/erpnext/selling/page/sales_funnel/sales_funnel.js
index 99d3d07..47b6a14 100644
--- a/erpnext/selling/page/sales_funnel/sales_funnel.js
+++ b/erpnext/selling/page/sales_funnel/sales_funnel.js
@@ -28,9 +28,9 @@
this.elements = {
layout: $(wrapper).find(".layout-main"),
- from_date: wrapper.appframe.add_date(__("From Date")),
- to_date: wrapper.appframe.add_date(__("To Date")),
- refresh_btn: wrapper.appframe.set_title_right(__("Refresh"),
+ from_date: wrapper.page.add_date(__("From Date")),
+ to_date: wrapper.page.add_date(__("To Date")),
+ refresh_btn: wrapper.page.set_primary_action(__("Refresh"),
function() { me.get_data(); }, "icon-refresh"),
};
diff --git a/erpnext/stock/page/stock_ledger/stock_ledger.js b/erpnext/stock/page/stock_ledger/stock_ledger.js
index 84e5b9b..af0eba2 100644
--- a/erpnext/stock/page/stock_ledger/stock_ledger.js
+++ b/erpnext/stock/page/stock_ledger/stock_ledger.js
@@ -20,7 +20,7 @@
title: __("Stock Ledger"),
page: wrapper,
parent: $(wrapper).find('.layout-main'),
- appframe: wrapper.appframe,
+ page: wrapper.page,
doctypes: ["Item", "Item Group", "Warehouse", "Stock Ledger Entry", "Brand", "Serial No"],
})
},
diff --git a/erpnext/stock/page/stock_level/stock_level.js b/erpnext/stock/page/stock_level/stock_level.js
index 785ad7f..e54c518 100644
--- a/erpnext/stock/page/stock_level/stock_level.js
+++ b/erpnext/stock/page/stock_level/stock_level.js
@@ -25,7 +25,7 @@
title: __("Stock Level"),
page: wrapper,
parent: $(wrapper).find('.layout-main'),
- appframe: wrapper.appframe,
+ page: wrapper.page,
doctypes: ["Item", "Warehouse", "Stock Ledger Entry", "Production Order",
"Material Request Item", "Purchase Order Item", "Sales Order Item", "Brand", "Serial No"],
});
diff --git a/erpnext/support/page/support_analytics/support_analytics.js b/erpnext/support/page/support_analytics/support_analytics.js
index 95c5fc8..54e6d68 100644
--- a/erpnext/support/page/support_analytics/support_analytics.js
+++ b/erpnext/support/page/support_analytics/support_analytics.js
@@ -21,7 +21,7 @@
title: __("Support Analtyics"),
page: wrapper,
parent: $(wrapper).find('.layout-main'),
- appframe: wrapper.appframe,
+ page: wrapper.page,
doctypes: ["Issue", "Fiscal Year"],
});
},